|
Right now I have a search that contains c(eval(status<=400)) AS SUCCESS c(eval(status>400)) AS FAILURE. This works, producing a chart of failures and sucesses. But now I want to change it so it has a WARNING category. This would include only status=404. But to do this I would have to change the FAILURE category to something like, status>400 AND status !=404. But the case statement does not seem to allow this. Can anyone help me with this? |
|
Which case statement? The
Ayn, This does not work at least with timechart
(09 May '12, 08:30)
joegrossman
But it does! I just tried it myself.
(09 May '12, 10:39)
Ayn
|
|
Or you can do it through
Then you have the information in the newly created field ' Hope this helps, Kristian |
|
The question was not answered (which seems to be the normal): So, is:
Supposed to be a valid construct? In my case i can't get it to work. It's either the default branch (1==1) or NULL. Any hints? Dirk While I can totally appreciate frustration, please remember that most splunk-base participants do not work for Splunk and are answering people's questions on a completely volunteer basis. I don't think your "which seems to be normal" comment is fair to those who do spend a lot of time trying to offer free help on here. Splunk has paid support options available to you if the community is not able to help you solve your problems.
(06 Feb, 08:22)
dwaddle ♦
It was just a observation, no critique of the participants was implied.
(06 Feb, 08:33)
dvl077
|
|
I can get it to work with the following search
For sake of clarity/completeness, I've included the complete search I used. The first three lines are just for getting event data (based off access_combined) to work on, so they don't have any real purpose besides that. The results table looks like;
Hope this helps, Kristian |
|
I confirm, the boolean expression in case() works. My problem was the following: To gather one of the needed values to decide on i did the following:
Note that the introduced variable and the constant string in the mkfind are identical. Interesting is: if you output the variable, e.g. via "table no-value-supplied" the value binding is correct (1 or 0 in this case). Using no-value-supplied in a boolean statement inside of case
never yields true. Is this a bug, or did i miss something in the documentation? Renaming the variable fixed the issue. My experience is that dashes can sometimes be confused for subtract. As a point of habit, I separate words in my field names with underscore.
(06 Feb, 08:29)
sowings
|