How can i get the hourly count of events per host (events in the past 24 hours). For e.g.
|metadata type=hosts index=* , gives the totalcount. Is there a way to aggregate this number by events in an hour. I would like to have one row for every host and the column header to be more like -
host, totalcount, Hour(1), Hour(2), Hour (3), Hour (4).....Hour (24), where the aggregate of Hour(1) to Hour (24) adds to the totalcount.
@swinod ,
Try this and test
|tstats count where index=* by _time,host span=1h |eval time=strftime(_time,"%H")
|chart first(count) over host by time| addtotals fieldname=Total row=t
You may adjust the index part to get the count from specific index