Splunk Search

How to convert date to epoch?

Shakira1
Explorer

I have this date string example: Mon, 01 May 2023 00:00:00 GMT

how can I convert it to epoch

 

thanks!

Labels (1)
Tags (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

strptime() will convert strings to epoch times

| eval _time=strptime(time,"%a, %d %b %Y %H:%M:%S %Z")

View solution in original post

0 Karma

Shakira1
Explorer

thank you, its working!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

strptime() will convert strings to epoch times

| eval _time=strptime(time,"%a, %d %b %Y %H:%M:%S %Z")
0 Karma
Get Updates on the Splunk Community!

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...

Get ready to show some Splunk Certification swagger at .conf24!

Dive into the deep end of data by earning a Splunk Certification at .conf24. We're enticing you again this ...

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

Now On-Demand Join us to learn more about how you can leverage Service Level Objectives (SLOs) and the new ...