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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...