Hello!
What I'm trying to do is if check if any of the events meet a criteria and if so I want to assign all events a particular field and value.
E.G.
I want to check if any of the RequiredValue field has a value of "Yes". If so all events get the ConditionalValue of "Yes" if not they all get a value of "No"
ID | RequiredValue | ConditionalValue |
1 | No | Yes |
2 | No | Yes |
3 | No | Yes |
4 | Yes | Yes |
5 | No | Yes
|
Any help would be greatly appreciated. Thanks!
| makeresults count=5
| streamstats count as ID
| eval RequiredValue=mvindex(split("Yes,No",","),random() % 2)
| rename COMMENT as "This is sample. Each time you search, the value changes.
From here, the logic."
| eventstats count(eval(RequiredValue="Yes")) as ConditionalValue
| eval ConditionalValue=if(ConditionalValue > 0,"Yes","No")
| table ID RequiredValue ConditionalValue
| makeresults count=5
| streamstats count as ID
| eval RequiredValue=mvindex(split("Yes,No",","),random() % 2)
| rename COMMENT as "This is sample. Each time you search, the value changes.
From here, the logic."
| eventstats count(eval(RequiredValue="Yes")) as ConditionalValue
| eval ConditionalValue=if(ConditionalValue > 0,"Yes","No")
| table ID RequiredValue ConditionalValue
Thanks so much! Worked like a charm!