HI
If you want to count all event then index = "SAMPLE INDEX" | stats count('NEW STATE')) as "COUNT" is batter.
If you are using dropdown in dashbard then below search will be useful to you.
Let say dropdown token = tokenDropdown then search is:
index = "SAMPLE INDEX" | eval selectedValue="$tokenDropdown$", NEW_STATE=if(selectedValue=="*",'NEW STATE',selectedValue) | stats count(eval('NEW STATE' = 'NEW_STATE')) as "COUNT"
If you select ALL (value=*) in dropdwn then search will be
index = "SAMPLE INDEX" | eval selectedValue="*", NEW_STATE=if(selectedValue=="*",'NEW STATE',selectedValue) | stats count(eval('NEW STATE' = 'NEW_STATE')) as "COUNT"
If you select STATE ONE (value=STATE ONE) in dropdwn then search will be
index = "SAMPLE INDEX" | eval selectedValue="STATE ONE", NEW_STATE=if(selectedValue=="*",'NEW STATE',selectedValue) | stats count(eval('NEW STATE' = 'NEW_STATE')) as "COUNT"
Can you please try this??
Thanks
... View more