Getting Data In

Requirement of a datetime.xml to extract from eventdata AND filename.

rschutt
Explorer

Hello,
I'm have a requirement of reading historical data that has NO year included in the eventdata. The good news is that the filenames include the year. This means the by default Splunk only extracts the day and month but the year is the current year. How can I override only the year from the filename?

Many thanks in advance!

Tags (1)
0 Karma
1 Solution

gelica
Communicator

Old question, but if someone else is having this problem, here's what I did:

I've had a similar problem and wasn't able to make it work by editing datetime.xml. The difference is that I had the whole timestamp included in the filepath.

Instead I added this line to my props.conf to override _time. file_date is the timestamp I'v extraxted from my filename.

EVAL-_time=strptime(file_date,"%Y-%m-%d_%H-%M-%S")

View solution in original post

0 Karma

gelica
Communicator

Old question, but if someone else is having this problem, here's what I did:

I've had a similar problem and wasn't able to make it work by editing datetime.xml. The difference is that I had the whole timestamp included in the filepath.

Instead I added this line to my props.conf to override _time. file_date is the timestamp I'v extraxted from my filename.

EVAL-_time=strptime(file_date,"%Y-%m-%d_%H-%M-%S")
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...