Splunk Search

Is there an easy way to convert the default time stamp to epoch time?

sherman
Engager

Hello,

I am trying to convert the default time stamp for my events to epoch time, but for that it seems that I have to concatenate date_month, date_year, date_mday, date_hour etc... to a single string and then use the strptime function:

eval t=date_month+","+date_mday+","+date_year+" " +date_hour+":"+date_minute+":"+date_second

and then pipe it to:

eval d=strptime(t,"%b,%d,%Y %H:%M:%S")

is there an easier or faster way to do that?

Tags (1)
1 Solution

hexx
Splunk Employee
Splunk Employee

Indeed there is a simpler way. Try:

eval t=_time

View solution in original post

hexx
Splunk Employee
Splunk Employee

Indeed there is a simpler way. Try:

eval t=_time

sherman
Engager

Thank you very much!

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...