Getting Data In

Use of Multiple Timestamps in one Index

Wushu
Explorer

For the purpose of this problem lets say I have one index, in this index I receive syslog events - one such event has three timestamps. I need to extract the third timestamp for this event.

Aug 15 10:27:23 Host2124.bleh Aug 15 10:27:23 Message forwarded from Host2124: AIXAudit: FILE_Write root FAIL Mon Aug 15 10:01:05 2011

The rest of the events in the index tend to have the usual two and is generally not a problem (splunk takes this fine);

Jul 27 16:04:19 Host3212.bleh.co.uk Jul 27 16:04:19 Message forwarded from Host3212

Does anyone know of a method to have the third timestamp extracted only for that first event and leave the rest of the events in the index as they are? Almost as if we said.. If this regex matches then apply the following timestamp parsing..

Note - These events are the same sourcetype, same index..
Thanks in advance

Tags (1)
0 Karma

supersleepwalke
Communicator

In theory, using TIME_PREFIX with a greedy regex should work. Something like:

TIME_PREFIX="^.*Message forwarded from"

should find the last instance of "Message forwarded from" since .* is greedy and will consume as much as it can. TIME_PREFIX essentially consumes and excludes part of the line from timestamp recognition.

That being said, I'm having trouble getting TIME_PREFIX to work for me at the moment, YMMV.

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!

Break the Build: Inside the KubeDoom Lounge at .conf26

    You step up to the machine. The pixelated corridors of a certain 1993 FPS load in front of you, EMP Pulse ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...