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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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