Splunk Search

Regex Expression to find errors not matching

sphiwee
Contributor

Can someone show me what the regex expression for the below extract would be? & can you show me how you arrived to that conclusion, NB i have tried reg101 and Im still confused.

 

i have tried this expression

rex field=_raw "ERROR - (?<Error_Message>.+)"

 

2020-08-17 16:34:02,141 [68618-1397] ERROR NodePoolServlet - [urn:uuid:6144BCB27826B3BECC1597674752077153] Bot Manager can't find a free Bot to execute a robotic task. Please check that Bots with requested capabilties are alive using the Healtcheck API and the Bot Source size in Control Tower is equal to the number of available Bots.

Labels (3)
Tags (1)
0 Karma

thambisetty
SplunkTrust
SplunkTrust

The regex you posted extracted nothing from the event posted.

rex field=_raw "ERROR - (?<Error_Message>.+)" to explain your regex.

field=_raw - indicates Splunk to look  in _raw field for extraction ERROR - (?<Error_Message>.+)

The extraction "ERROR - (?<Error_Message>.+)" - first identify  ERROR - and value will be extracted after ERROR - till end of line  and the value will be kept in Error_Message field.

Find below video useful

Regular Expressions in Splunk 

————————————
If this helps, give a like below.
0 Karma

to4kawa
Ultra Champion

rex field=_raw "ERROR - (?<Error_Message>.+)" is match

ERROR - <<SOMETHING>>

 

2020-08-17 16:34:02,141 [68618-1397] ERROR NodePoolServlet - [urn:uuid:6144BCB27826B3BECC1597674752077153] Bot Manager can't find a free Bot to execute a robotic task. Please check that Bots with requested capabilties are alive using the Healtcheck API and the Bot Source size in Control Tower is equal to the number of available Bots.

 

your log does not have -(hyphen) after ERROR. so this can't match.

"ERROR\s(?<Error_Message>\S+)"

0 Karma

impurush
Contributor

@sphiwee 
If I understand correctly, you need the error details in a keyword after the ERROR message.

2020-08-17 16:34:02,141 [68618-1397] ERROR NodePoolServlet - [urn:uuid:6144BCB27826B3BECC1597674752077153] Bot Manager can't find a free Bot to execute a robotic task. Please check that Bots with requested capabilties are alive using the Healtcheck API and the Bot Source size in Control Tower is equal to the number of available Bots.

You can use the below regex format to achieve that.

<your query>|rex field=_raw "ERROR\s(?<Error_Message>.+)"

 

sphiwee
Contributor

no only need this part "ERROR NodePoolServlet -"

0 Karma

impurush
Contributor

Hi @sphiwee 

Use the below one

<your query>|rex field=_raw "ERROR\s(?<Error_Message>.+)\-"
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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...