Splunk Search

extracting year from directory name & date/time from file

pljulien
New Member

I have syslog files that are in the directory structure of system/Hosts/year/month/day

I've been able to get the indexer to list the file date as date time (Aug 13 2:00:01) based on input to props.conf.

What I would really like to do is combine the year directory name combined with the date time (2013 Aug 13 2:00:01). Can anyone tell me if this is possible and if so how to do it. Without the year I'm not sure how I would be able to search for events happening at specific year month day

TIA
PJ

0 Karma

omniit
Explorer

You should be able to setup a regex for this. I am no specialist in this area, but I am certain that you could filter out a part of the pathname (e.g. the year, or the month, or both) and use it for whatever you would like.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...