For this Splunk query:
index=* | eval case(status="200", "is successful", status="300", is redirect, status="400", "is error", 1=1", is did not match")
I expected that I would get a result with a list of 200 as successful & 300 is as redirect 400 as error, but my eval command as error
There appear to be a couple of issues with your use of the
casestatement.You need to assign the result of the case statement to a field that can be used.
The quotes for your values are not correct.
is redirectdoesn't have any, andis did not match"has a trailing quote, but not a leading quote.You should use
==and not=when testing thestatusvalues.You need to do something with the results of your
caseTry something like this: