Sample Header Ad - 728x90

How to convert timestamp value to number and then convert to human readable

5 votes
2 answers
3754 views
I have a string timestamp key I need to convert to a number because strftime throws an error that it needs to be a number. journalctl -n1 --output=json | jq '.__REALTIME_TIMESTAMP | tonumber |= (. / 1000 | strftime("%Y-%m-%d")), .MESSAGE' but I get invalid path expression errors. I assume I don't have the syntax down right. I ultimately want to display key __REALTIME_TIMESTAMP in human readable format and key MESSAGE.
Asked by user168989
Nov 11, 2023, 09:43 PM
Last activity: Feb 4, 2025, 12:24 PM