Splunk Enterprise

help on eval case

jip31
Motivator

hi

splunk tells me that "the arguments to the case function are invalid"

what is wrong please?

 

| eval site=case(site=="SAINT MAXIMIN LA SAINTE BA", "SAINT MAXIMIN LA SAINTE BAUME", 1)

 

 

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

case needs pair of arguments i.e. an even number of arguments, you have an odd number

| eval site=case(site=="SAINT MAXIMIN LA SAINTE BA", "SAINT MAXIMIN LA SAINTE BAUME", 1==1,"Unknown")
0 Karma

jip31
Motivator

perfect thanks

last question, if I want to do the same thing with a regex, how o do please?

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Seamless IT/OT Security: A Hands-On Look at the Cisco Cyber Vision Splunk Add-on

With just a few clicks, you can ingest critical OT asset details, vulnerabilities, baseline deviations, ...