Currently I can search out the tablet name which has no data sent for more than 24 hours with below command 1. However, I also want to get the priority of them based on their performance (with command 2). Which means higher performance owns higher priority, even their silence hour may not be the highest.
could you please kindly guide me on how to combine these two commands together to get a final list, which is sorted by priority already.
shop_tags= "*wumart*" interaction_count="*" LIVE |stats latest(_time) AS lastReportTime BY mount_name | eval silenceSeconds = now() - lastReportTime |eval silenceHour = silenceSeconds/3600 | where silenceHour > 24 |table mount_name, silenceHour |eval silenceHour =round(silenceHour,1) |sort -silenceHour
shop_tags= "*wumart*" interaction_count="*" LIVE |stats sum(interaction_count) AS sum_interaction_count BY mount_name |sort -sum_interaction_count
I have no idea what you mean by "priority" since there are no fields by that name. However, this will combine the two commands:
shop_tags= "*wumart*" interaction_count="*" live | stats latest(_time) as lastReportTime sum(interaction_count) as sum_interaction_count by mount_name | eval silenceSeconds = now() - lastReportTime | where silenceHour > 86400 | sort -silenceHour -sum_interaction_count | fieldformat silenceHour=tostring(silenceHour,"duration")
Priority is defined by the performance of command2. According to the second command, i can get the interaction count for each tablet, so those who has higher performance, will get higher priority, so command1 can display according to that .
Do you have any idea on this situation?
Thanks so much.