Splunk Search

Convert Snap-To Time to Epoch Time

michaelsplunk1
Path Finder

Hi everyone!

My time picker token spits out values like "-60m@m" and I want to convert this time value into an epoch time so I can filter based on epoch time. How do I convert this? Can I use strptime() to do it? What format would I tell strptime() the time is in?

Thank you!

Tags (3)
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval epochtime=relative_time(now(),"-60m@m")

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| eval epochtime=relative_time(now(),"-60m@m")

to4kawa
Ultra Champion

your search
| addinfo
| eval your_time=strftime(info_min_time,"%F %T")

try addinfo command. info_min_time is epoch.

Get Updates on the Splunk Community!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...