How do we convert unix time into string and string back to unix time format?
Answer Posted / Deepak Singh Rathore
In Splunk, you can convert Unix time to a readable date/time string using the strftime function (e.g., index=_internal| timechart span=1h by _time| eval date=`strftime("%Y-%m-%d %H:%M:%S",_time)`). To convert a string back to Unix time, use the strptime function (e.g., index=_internal | eval unixtime = strptime(date, "%Y-%m-%d %H:%M:%S")).
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers