For example:
raw data is
100,x,info=1,error=1,warn=1
101,x,info=1,error=1,warn=1
101,y,info=1,error=2,warn=1
101,y,info=1,error=3,warn=1
| query
| chart count by x y
| addtotals col=true labelfield=x label="Totals"
Sample results
event, info, error, warn Total
x 2 2 2 6
y 2 5 2 9
Totals 4 7 4 15
In the above query I want to sort the data based on group by query results in desc order. when i try | sort 0 -Totals, Totals column appearing first row in table.
| query
| chart count by x y
| addtotals col=true labelfield=x label="Totals"
| sort 0 -Total
Result:
event, info, error, warn Total
Totals 4 7 4 15
y 2 5 2 9
x 2 2 2 6
But I want to display results as
event, info, error, warn Total
y 2 5 2 9
x 2 2 2 6
Totals 4 7 4 15
Any inputs here really helps me. Thanks
... View more