Splunk Search

TIME_FORMAT in Epoch

shangshin
Builder

Hi,
My log event is in xml and the timestamp is in epoch format e.g. <timestamp>1399909145002</timestamp>

How can I define this in props.conf so the event timestamp will be correctly indexed in splunk?

Thanks in advance!

0 Karma
1 Solution

dmaislin_splunk
Splunk Employee
Splunk Employee
TIME_PREFIX = \<timestamp\>

View solution in original post

dwaddle
SplunkTrust
SplunkTrust

Well, you have a slight complication there. What you have there isn't truly epoch (number of seconds since 1/1/1970 00:00:00 GMT). What you have is the number of milliseconds.

But it appears this will work --

[test2] 
TIME_PREFIX=<timestamp> 
TIME_FORMAT=%s%3N 

dmaislin_splunk
Splunk Employee
Splunk Employee

Good point!

0 Karma

dmaislin_splunk
Splunk Employee
Splunk Employee
TIME_PREFIX = \<timestamp\>

dmaislin_splunk
Splunk Employee
Splunk Employee

Excellent! Thanks for the upvote!

0 Karma

shangshin
Builder

The magic works. Thank you.

0 Karma

dmaislin_splunk
Splunk Employee
Splunk Employee

If you showed me an entire XML event then I could help you with your event line breaking too.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...