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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

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

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...