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
Legend

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!

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 ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...