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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...