Splunk Search

How to convert time into the Epoch format

samarkumar
Path Finder

Hi
I have a timestamp field with values as below

"2016-08-25T13:30:36.82"
"2016-08-25T13:13:38.737"
"2016-08-25T11:05:32.76"

How i can convert this into the epoch time so that i can use the value to compare with other epoch value.

Your help will be greatly appreaciated.

0 Karma
1 Solution

sundareshr
Legend

Try this

... | eval t=strptime(timestamp. "%Y-%m-%dT%H:%M:%S")

View solution in original post

0 Karma

sundareshr
Legend

Try this

... | eval t=strptime(timestamp. "%Y-%m-%dT%H:%M:%S")
0 Karma

samarkumar
Path Finder

I had a discussion with Sundaresh, and i tried below thing and it works as expected.

..|eval t=strptime(timestamp, "\"%Y-%m-%dT%H:%M:%S")|..

Thank You.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...