I've 'narrowed down' the problem:
the search in the dashboard panel looks like this:
search xxx | stats count(Name) as search1
| eval search2=[search yyy | stats count(Name) as search2| rename search2 as query]
| table search1, search2
search1 is ok, search2 produces the wrong result but if I did this in the dashboard panel:
search yyy | stats count(Name) as search2 | table search2
The correct result comes up.
Just to re-iterate:
if I go to the dashboard panel, hit 'open in search', the panel search will appear, I hit 'search', and the correct result appears. Because of this, I'm leaning away from the fact that the syntax is the issue. Something about the way the dash executes the search provides incorrect results.
Before you ask, the reason why I need the two searches in the one dash is because I'm trying to get a percentage from the two searches:
search xxx | stats count(Name) as search1
| eval search2=[search yyy | stats count(Name) as search2| rename search2 as query]
| eval percent=round((search2/search1)*100,2).%
... View more