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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...