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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...