I have the following:
cat /var/log/example.log | cut -d ' ' -f 3,4,5,6 | sort -u | uniq
The result has several thousand lines but I would like to cut this down to show the actual activity and to do this, I would need to exclude/ignore the IP address
So the log has records such as:
2021-12-30 19:46:44 Invalid heartbeat from X.X.X.X
2021-12-30 19:46:44 X.X.X.X sent a malformed request
2021-12-30 19:46:44 Login from X.X.X.X failed due to bad username
2021-12-30 19:46:44 Failed login from this IP X.X.X.X
There are tens of thousands of records - how do I get the activity i.e.
Invalid heartbeat from
sent a malformed request
Login from failed due to bad username
Failed login from this IP
Thanks
sort -u=sort | uniqso you never needsort -u | uniq.