Getting Data In

Extract Timestamp from logs that don't contain any Year reference

lmeur
Engager

I need to extract a timestamp from log files looking like that :

Feb 16 23:58:44 ...

As you can see, there is no reference to the year when the log was generated, so what I want to do is to extract day, month and hour reference and then mix it with current year from the splunk instance (or from the file last modification date).

Do you see a simple way to do this ?

Ludovic.

Tags (1)

Ant1D
Motivator

Hi,

When you run a search on these logs in your Splunk instance, you will see fields on the left-hand side that you can pick from. Select the last option that says All (number) fields. There should be a field named date_year that you can use.

Ant1D
Motivator

My understanding is that you can either: Clean your index, edit the timestamps in the logs manually to include the year and then have these logs indexed in order to see the year in the timestamp as the value for the date_year field OR if this is not efficient then maybe you can achieve this in props.conf via a field extraction

0 Karma

lmeur
Engager

date_year allow me to get date field on search results but what I'm looking for is to change year on date_year field before indexing logs (during logs fields extraction)

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...