Getting Data In

How to configure props.conf to parse timestamps for two different types of events?

a212830
Champion

Hi,

I have a feed that has two different types of events and need to grab them both. Not sure how to do it...here's a sample:

Tracking ntp.fmr.com [1.2.3.4].
The current time is 6/14/2016 1:25:29 PM.
13:25:29 d:-00.0000359s o:-00.0204019s  [                           *                           ]
13:26:29 d:-00.0000379s o:-00.0215103s  [                           *                           ]
13:27:29 d:-00.0000370s o:-00.0224686s  [                           *                           ]
Tracking ntp.fmr.com [1.2.3.4].
The current time is 6/14/2016 1:41:12 PM.
13:41:12 d:-00.0000390s o:+00.1655246s  [                           *                           ]
13:42:12 d:-00.0000452s o:+00.1666010s  [                           *                           ]
13:43:12 d:-00.0000363s o:+00.1684723s  [                           *                           ]
13:44:12 d:-00.0000391s o:+00.1697982s  [                           *                           ]

I want to grab the first two lines as one event, using the second line's timestamp, and grab the ones below as single line events, using that timestamp and then do the same as they appear.

darrenfuller
Contributor

Here's a props.conf sourcetype definition that does that...

[SourcetypeName]
SHOULD_LINEMERGE=true
NO_BINARY_CHECK=true
BREAK_ONLY_BEFORE=(Tracking|\d{2}\:\d{2}\:\d{2}\s)
LINE_BREAKER=([\r\n]+)
TRUNCATE=300

Explanation...

SHOULD_LINEMERGE set to true so Splunk considers multiline events
LINE_BREAKER is set to either carriage return (\r) or newline (\n) to cover different line break encoding
BREAK_ONLY_BEFORE further restricts the line breaking to only occur when the regex pattern occurs after the newline

Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...