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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...