This :
... | stats count
will return 0 if there's no results
this :
... | stats count by watch
will return nothing if there's no results, because there's no 'watch' to split over, you dont get 0 , so the rangemap doesnt have a value.
So you need to add a dummy line with lista=0 when appropriate.
... | stats max(count) as lista
| appendpipe [ stats count | eval lista=if(count==0,0,NULL) | fields - count ] | ...
etc etc. You could move the check forward in the search too, but this is the easiest way to explain it
... View more