Getting Data In

Splitting Events

johnboldt
Explorer

I am trying to configure Splunk to properly split events from a data source. Here's what an event looks like:

----------------------------------------
Timestamp: 2/20/2012 3:30:44 PM
<log details>
----------------------------------------

Each event begins and ends with dashes. The time stamp is always on the line after the initial dashes.

Here's what I have tried (none of which work):

[sourcetype]
LINE_BREAKER = ----------------------------------------([\n\r]+)Timestamp:\s\d{1,2}/\d{1,2}/\d{4}\s\d{1,2}:\d{2}:\d{2}\s[A|P]M
SHOULD_LINEMERGE = false
MAX_EVENTS = 10000
MAX_TIMESTAMP_LOOKAHEAD = 80

[sourcetype]
LINE_BREAKER = ([\n\r]+)Timestamp\s*:\s\d{1,2}/\d{1,2}/\d{4}\s\d{1,2}:\d{2}:\d{2}\s[A|P]M
TIME_PREFIX = Timestamp\s*:\s*
SHOULD_LINEMERGE = false
MAX_EVENTS = 10000
MAX_TIMESTAMP_LOOKAHEAD = 35

[sourcetype]
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE = ----------------------------------------[\n\r]+Timestamp\s*:\s*\d{1,2}\/\d{1,2}\/\d{4}\s*\d{1,2}:\d{1,2}:\d{1,2}\s*[A|P]M
TIME_PREFIX = Timestamp\s*:\s*
MAX_EVENTS = 10000
MAX_TIMESTAMP_LOOKAHEAD = 35

SHOULD_LINEMERGE=false
LINE_BREAKER=----------------------------------------[\n\r]+Timestamp\s*:
TIME_PREFIX=Timestamp\s*:\s*
TIME_FORMAT=%m/%d/%Y %r

What am I missing?

Tags (1)
0 Karma

jbsplunk
Splunk Employee
Splunk Employee

Give this a try:

LINE_BREAKER = \-+([\n\r])Timestamp:\s+

If it doesn't help, you may want to check splunkd.log for errors related to this line breaking failing. You could also check btool to ensure that the configuration is being read, run 'splunk cmd btool props list --debug > ~/output from $SPLUNK_HOME/bin/. I presume that all events carry the sourcetype you've specified in the 'sourcetype' metadata field?

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...