Splunk Search

REGEX Extraction for btool.log

hartfoml
Motivator

I have these btool logs:

10-29-2013 09:15:34.551 INFO AdminManager - added factory for admin handler: 'licenses'
10-29-2013 09:15:34.551 DEBUG AdminManager - Found path '/opt/splunk/etc/apps/search/bin' for handler 'sendemail'.
29-2013 09:15:34.551 DEBUG HTTPRestDispatcher - loadConfig for masterlm _isProServer=1

When I do the automated extraction if looks like this:

(?i) DEBUG (?P<FIELDNAME>[^ ]+)

This does not find the valus followed by INFO. How could I right this so it is not dependent on the word "DEBUG"

Tags (1)
0 Karma
1 Solution

gfuente
Motivator

Hello

try this:

(?i) (DEBUG|INFO) (?P<FIELDNAME>[^ ]+)

And add with pipes any other severity values you would like to capture

regards

View solution in original post

gfuente
Motivator

Hello

try this:

(?i) (DEBUG|INFO) (?P<FIELDNAME>[^ ]+)

And add with pipes any other severity values you would like to capture

regards

hartfoml
Motivator

Thanks again for the help.

I should have put in the things I tried at the beginning.

I tried (?i) \w+ (?P<fieldname>[^ ]+)
and this (?i) \w+\s (?P<fieldname>[^ ]+)
and this (?i)\w+\s(?P<fieldname>[^ ]+)\s\-\s

0 Karma

gfuente
Motivator

then use this:

(?i) \w+ (?P<FIELDNAME>[^ ]+)

There is a "\" before the w+

0 Karma

hartfoml
Motivator

Right Thanks, I did think of doing this but what if there is a WARN or ERROR. I didn't want to put (DEBUG|ERROR|WARN|INFO) I was hoping for a more elegant way to right it.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Event Series: Telemetry Pipeline Management

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...

Deep insights, no barriers: Splunk Observability Cloud Free Edition

As software delivery cycles continue to accelerate, observability shouldn’t be a luxury — it should be a ...