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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...