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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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