Splunk Search

How to edit my eval statement to resolve "Error in 'eval' command: Regex: nothing to repeat"?

marina_rovira
Contributor

Hello all,

I'm trying to filter some event by their Summary. I just want to distinguish when they have the word Maintenance and catalogue the rest as "other".

My eval statement is this:

eval camp = if(match(Summary,"*Planned*"),"mainten","other") | top limit=50 Summary,camp

I'm trying with Planned because if I put "maintenance", I get this error:

Error in 'eval' command: Regex: nothing to repeat 

but there can be planned and emergency maintenances and I want all of them as the same group.

Any idea why and how can I resolve this error?

Thank you in advance.

0 Karma
1 Solution

renjith_nair
SplunkTrust
SplunkTrust

You don't need * in your match. Match matches the string with wild cards.

Try using

 eval camp = if(match(Summary,"Planned"),"mainten","other") | top limit=50 Summary,camp
Happy Splunking!

View solution in original post

renjith_nair
SplunkTrust
SplunkTrust

You don't need * in your match. Match matches the string with wild cards.

Try using

 eval camp = if(match(Summary,"Planned"),"mainten","other") | top limit=50 Summary,camp
Happy Splunking!

marina_rovira
Contributor

Thank you! 🙂 It works now

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...