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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...