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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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