Getting Data In

Newbie question - can't get Splunk to locate the timestamp in redis log file

socalvin
New Member

The following settings don't seem to be able to tell Splunk to locate the timestamp, although I have tried using the same regex in vi editor to verify that the expression is correct. Any idea?

TIME_FORMAT=%d%t%b%t%H:%M:%S
TIME_PREFIX=\d{2}\s\w{3}\s\d{2}:\d{2}:\d{2}

Sample of the log:

[27779] 27 Mar 22:01:27 * 1 changes in 900 seconds. Saving...
[27779] 27 Mar 22:01:27 * Background saving started by pid 3915
[3915] 27 Mar 22:01:27 * DB saved on disk
[27779] 27 Mar 22:01:27 * Background saving terminated with success
[27779] 27 Mar 22:05:35 # Received SIGTERM, scheduling shutdown...
[27779] 27 Mar 22:05:36 # User requested shutdown...
[27779] 27 Mar 22:05:36 * Saving the final RDB snapshot before exiting.

Tags (2)
0 Karma

lguinn2
Legend

I think your TIME_PREFIX is wrong. And my real question is this: what happens if you leave all that out and just let Splunk figure it out? This is a pretty common format, and I think Splunk might not need all of this. I might go as far as this in props.conf (on the indexer):

MAX_TIMESTAMP_LOOKAHEAD=25
SHOULD_LINEMERGE=false

Because that makes Splunk a bit more efficient, not because it is really necessary.

But if Splunk can't figure out the timestamp on its own, you could add:

TIME_FORMAT=%d%t%b%t%H:%M:%S
TIME_PREFIX=\[\d+]\s
0 Karma

socalvin
New Member

It still removed the strokes. Hopefully, someone in this forum or from Splunk could help me out. Thanks!

0 Karma

socalvin
New Member

It looks like the editor in this forum removed all the stroke in the regex. It should be:

"\d{2}\s\w{3}\s\d{2}:\d{2}:\d{2}"

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...