Unix timestamp to Human readable date time format conversion

154 views
Skip to first unread message

Asim Minhas

unread,
Nov 11, 2022, 7:58:24 AM11/11/22
to Wazuh mailing list
Dear All, 

I am trying to ingest some custom logs with date and time recorded in Unix timestamp format. I need to convert the timestamp to human-readable format and store them in custom fields. 

sample of the record is 

1 0d1803175532f48c0193fb2d0a9 8602911b4e-72e2c69c6d6b XXX.XXX.XXX.XXX YYY.YYY.YYY.YYY 1234 1234 6 2 148 1666225174 1666225774 REJECT OK

the highlighted text in the above log is basically the date and time of actual event

1666225174 -> Thursday, October 20, 2022 12:19:34 AM 
1666225774 -> Thursday, October 20, 2022 12:29:34 AM

Regards,


mariano hinjos

unread,
Nov 14, 2022, 2:44:13 AM11/14/22
to Asim Minhas, Wazuh mailing list
In linux you can execute the next command:
date -d@1666225174 +"%D %H:%M:%S"

10/20/22 02:19:34

--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/191ed338-9d12-472d-a32a-9f9c124cb28dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages