Splunk Search

_time from filename using Eval

SplunkBaby
Explorer

Hi

My file name is like ABC20140321.csv
I want splunk to read _time value from this file name.
I tried to edit datetime.xml and props.config and it doesn't work out for me.
How can I achieve this using EVAL in props.config

Thanks

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Have you read http://blogs.splunk.com/2009/12/02/configure-splunk-to-pull-a-date-out-of-a-non-standard-filename/?

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Is your datetime.xml file really in $SPLUNK_HOME/etc or $SPLUNK_HOME/etc/system/local?
Perhaps some escape characters got dropped from your comment, but your regex doesn't look right. This works in RegExr:

\ABC(\d{4})(\d{2})(\d{2})\.csv
---
If this reply helps you, Karma would be appreciated.
0 Karma

SplunkBaby
Explorer


<![CDATA[source::.?\ABC\d{4}\d{2}\d{2}..csv]]>



[host::DateFormat2]
DATETIME_CONFIG =/etc/datetime.xml
SHOULD_LINEMERGE = FALSE

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please post your datetime.xml file and the relevant stanza from your props.conf file.

---
If this reply helps you, Karma would be appreciated.
0 Karma

SplunkBaby
Explorer

Yes ,unfortunately its not working for me.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...