Hi @annageorgiou,
as @renjith.nair said, after stats command you have only the fields of stats command, in your case only TotalSent, TotalRcvd and app; to use some other fields you have to use other functions like values, sum, max, avg.
So in your search, try:
index= *
| eval TotalMB=round((TotalSent+TotalRcvd)/1024/1024,2)
| eval TotalGB=round(TotalMB/1024,2)
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd values(TotalGB) AS TotalGB by app
| addtotals
| sort limit=30 - total
p.s.: you don't need dedup after stats.
Ciao.
Giuseppe
... View more