Splunk Search

How to convert a lookup date field to epoch

theouhuios
Motivator

Hello

I have a lookup table which has a Datetime field like 1/20/2013 or 4/29/2013. Now I need to convert it to epoch time to compare it to the normal time when the search ran. We can take the H:M:S as 00:00:00.

Any idea on what can be done?

Thanks

Tags (1)
0 Karma

rturk
Builder

Hi Theouhuios,

What you will need to do is specify in the lookup definition (in transforms.conf) that one of the fields is in fact a time value. There shouldn't be any need to convert it to epoch seconds.

Example:

[eventLookup]
filename = events.csv
time_field = Datetime
time_format = %m/%d/%Y

Without the hours, minutes, and seconds being defined it should default to 00:00:00.

Hope this helps 🙂

Ref: http://docs.splunk.com/Documentation/Splunk/5.0.4/Knowledge/Addfieldsfromexternaldatasources#Set_up_...

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...