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 Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...