Splunk Enterprise Security

How may I change MM/DD/YYYY HH:MM:SS to epoch time?

jsven7
Communicator

Situation:
- I have some records with a human readable field "Creation Date" (MM/DD/YYYY HH:MM:SS).
- I'd like to sort by "Creation Date"

Problem:
- The sort command does not appear to work. I believe this is because it needs to be in epoch time to make the calculation.

Proposed Solution:
- Convert the field to epoch and run the sort command against the data set using the new epoch field.

0 Karma
1 Solution

vnravikumar
Champion

Hi

Check this

| makeresults 
| eval "Creation Date"="03/26/2020 13:56:12" 
| eval epoch=strptime('Creation Date',"%m/%d/%Y %H:%M:%S")

View solution in original post

vnravikumar
Champion

Hi

Check this

| makeresults 
| eval "Creation Date"="03/26/2020 13:56:12" 
| eval epoch=strptime('Creation Date',"%m/%d/%Y %H:%M:%S")

jsven7
Communicator

@vnravikumar - thank you!

0 Karma
Get Updates on the Splunk Community!

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

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...