I'm trying to show a pie-chart distributed by country that when you go into view-results you can export to a csv.
A requirement is to include the totals, so I used "| addcoltotals labelfield=country label=ALL" of course now the pie chart have a 50% that corresponds to the country "ALL". Is there a way to exclude this row just from the chart representation? (Without just creating two different reports)
Not too pretty, but this might work:
| gentimes start=-1 increment=5m | eval divider = starttime % 900 | stats avg(starttime) as avg by divider | eval total = avg | addcoltotals total | eval total = if(isnull(divider),total,null)
Put the "| gentimes ..." into the search bar on its own, to get a full example with generated events.
I tried but tells me that gentimes have to be the first command. This is the original query:
earliest=-1d@d sourcetype="singleline_json" _type="UserReport" | stats dc(userId) AS "Number users" by country | addcoltotals labelfield=country label=ALL
So I tried: earliest=-1d@d sourcetype="singleline_json" _type="UserReport" | stats dc(userId) AS "Number users" by country | gentimes start=-1 increment=5m | eval divider = starttime % 900 | stats avg(starttime) as avg by divider | eval total = avg | addcoltotals total | eval total = if(isnull(divider),total,null)