Splunk Search

props.conf for specific log format

_gkollias
SplunkTrust
SplunkTrust

Hi All,

I'd like to create a props.conf for log files in this format:

   DEBUG[ScriptingSession] 2013-11-30 15:52:40.869 EST: <-initialize

Here is what I have so far:

[mws_debug]
SHOULD_LINEMERGE = false
TIME_PREFIX = ^
TIME_FORMAT=%Y-%m-%d $H:%M:%S.%3N
MAX_TIMESTAMP_LOOKAHEAD = 50
EXTRACT-mws_debug = "(?[^"]+)","(?[^"]+)","(?[^"]+)"

I think the field extraction is off, but I can't seem to get this to work.

Your help in modifying this stanza will be much appreciated.

Thanks!

Tags (3)
0 Karma
1 Solution

lguinn2
Legend

Here is a correct regular expression; as Martin pointed out, it was full of double quotes and was not a valid regex. You should not quote your regular expression, nor should it have internal quotes. I have corrected a few other settings as well.

[mws_debug]
SHOULD_LINEMERGE = false
TIME_PREFIX = \]
TIME_FORMAT=%Y-%m-%d $H:%M:%S.%3N
MAX_TIMESTAMP_LOOKAHEAD = 50
EXTRACT-mws=(?<debug>\S+)\[(?<session>\S+)\]\s+\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\.\d+\s(?<status>.*)

View solution in original post

lguinn2
Legend

Here is a correct regular expression; as Martin pointed out, it was full of double quotes and was not a valid regex. You should not quote your regular expression, nor should it have internal quotes. I have corrected a few other settings as well.

[mws_debug]
SHOULD_LINEMERGE = false
TIME_PREFIX = \]
TIME_FORMAT=%Y-%m-%d $H:%M:%S.%3N
MAX_TIMESTAMP_LOOKAHEAD = 50
EXTRACT-mws=(?<debug>\S+)\[(?<session>\S+)\]\s+\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\.\d+\s(?<status>.*)

lguinn2
Legend

Note that the extraction is broken into two lines in the post above, but it must be on a single line in your props.conf

0 Karma

_gkollias
SplunkTrust
SplunkTrust

I would like to use this format if possible.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

The field extraction indeed is off - I don't see any double quotes in the event, but your extraction is full of them.

Does event breaking and timestamping work for you?

Get Updates on the Splunk Community!

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 ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...