Hi,
I want to monitor var/log/messages, so I added a key log["/var/log/messages"]. However I'm struggling to get the correct timestamps. The contents of the logs are like this:
I believe I can't parse 'Nov 4', so I am only trying to parse only the time with this : ppppppph:m:sp
However it's not displaying with the correct timestamp:
Any suggestions to properly parse those logs?
Thanks
I want to monitor var/log/messages, so I added a key log["/var/log/messages"]. However I'm struggling to get the correct timestamps. The contents of the logs are like this:
Code:
Nov 4 07:58:22 bezaweb03 systemd: Removed slice User Slice of root. Nov 4 07:58:22 bezaweb03 systemd: Stopping User Slice of root. Nov 4 07:58:25 bezaweb03 pure-ftpd: ([email protected]) [INFO] New connection from 127.0.0.1 Nov 4 07:58:25 bezaweb03 pure-ftpd: ([email protected]) [INFO] Logout. Nov 4 07:58:55 bezaweb03 pure-ftpd: ([email protected]) [INFO] New connection from 127.0.0.1 Nov 4 07:58:55 bezaweb03 pure-ftpd: ([email protected]) [INFO] Logout.
However it's not displaying with the correct timestamp:
| 2018-11-05 14:29:10 | Nov 4 17:50:01 bezaweb03 systemd: Started Session c27280 of user root. |
Any suggestions to properly parse those logs?
Thanks
The current year I would suppose but there could be so many edge cases where the year is different etc.
Comment