Getting Data In

Timestamp extraction stops working on some lines and all future lines

johnansett
Communicator

Hello!

I have a log which has the following format:

12345|A123456/A12345678/some_thing|00:01:00|0|AA|a1234abc_aa_abc[123]|this is the message

If I set a time extraction of %T or %H:%M:%S it doesn't seem to work. If I leave it on auto it does work, but about 30 lines in it captures the whole beginning of the line and then changes the date.

The day month and year is extracted from the file name (in this case it is filename.21Feb19) and the first events have this correctly extracted but as soon as it reaches this line it fails. Further down in the file it also occurs.

Any ideas what's going on here?

Thanks!

0 Karma
1 Solution

woodcock
Esteemed Legend

Try this:

[<YourOriginalSourcetypeHere>]
TIME_PREFIX = ^([^|]*\|){2}
TIME_FORMAT = %H:%M:%S
MAX_TIMESTAMP_LOOKAHEAD = 8

If you have overridden/overwritten the original sourcetype, USE THE ORIGINAL VALUE.
Deploy to the first full instance of Splunk that handles the events (HF or Indexer tier).
Restart all Splunk instances there.
Send in new events.
When validating use All time for your Timepicker and add _index_earliest=-5m to your search string to see only new events (old events will stay broken).

View solution in original post

woodcock
Esteemed Legend

Try this:

[<YourOriginalSourcetypeHere>]
TIME_PREFIX = ^([^|]*\|){2}
TIME_FORMAT = %H:%M:%S
MAX_TIMESTAMP_LOOKAHEAD = 8

If you have overridden/overwritten the original sourcetype, USE THE ORIGINAL VALUE.
Deploy to the first full instance of Splunk that handles the events (HF or Indexer tier).
Restart all Splunk instances there.
Send in new events.
When validating use All time for your Timepicker and add _index_earliest=-5m to your search string to see only new events (old events will stay broken).

Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...