Splunk Search

get epoch time from string time example from 20090930 to epoch time?

srinathd
Contributor

get epoch time from string time example from 20090930 to epoch time?

Tags (1)
0 Karma

MuS
SplunkTrust
SplunkTrust

Hi srinathd,

based on your provided example try this run everywhere command:

index=_internal | head 1 | eval foo="20090930" | eval boo=strptime(foo, "%Y%m%d") | table foo, boo

where boo will be the epoch time. You can verify it by running this search:

index=_internal | head 1 | eval foo="20090930" | eval boo=strptime(foo, "%Y%m%d") | convert ctime(boo) AS newTime | table foo, boo, newTime

hope this helps ...

cheers, MuS

Get Updates on the Splunk Community!

.conf24 | Registration Open!

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

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...