Splunk Search

If I have a log file with timestamps in it, but no date, is there a way to extract date from the log file name and assign it?

a212830
Champion

Hi,

I have a logfile that has timestamps in it, but no date. The name of the logfile has a date - is there anyway to assign the date from the file? I know it would automatically post today's date, but sometimes these files show up late, so I'd like to extract it.

Format:

ORS_RTP_Node1_BK.20150107_133125_493.log

0 Karma

chanfoli
Builder

Yes, it can be done.

Check out the discussion and documentation regarding using datetime.xml to do this:

http://answers.splunk.com/answers/12015/setting-date-on-event-based-on-filename.html
(there is some bad formatting on the config code but you should get the idea)

http://docs.splunk.com/Documentation/Splunk/6.2.1/Data/Configuretimestamprecognition

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 ...