Splunk Search

Convert java millisecond to date

rameshlpatel
Communicator

Hi,

I am printing current time in java milisecond in logs which i want to show in splunk by converting that into date.

STARTTIME=1420199729284

please help me to convert this into date.

Tags (2)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

If you're trying to parse that at index time, use this in props.conf:

TIME_FORMAT = %s%3N

If you're trying to format that into a readable date at search time, use this:

... | eval readable_date = strftime(STARTTIME/1000, "%F %T.%3N")
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...