Splunk Search

how to set priority for each server based on their performance

tenyang
New Member

Hi all,

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.

Command 1:

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

Command2:

shop_tags= "*wumart*" interaction_count="*" LIVE 
|stats sum(interaction_count) AS sum_interaction_count BY mount_name 
|sort -sum_interaction_count

Thanks again.

Tags (3)
0 Karma
1 Solution

lguinn2
Legend

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")

View solution in original post

0 Karma

lguinn2
Legend

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")
0 Karma

tenyang
New Member

hi Lguinn,

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.

0 Karma

lguinn2
Legend

Then change the sort to
| sort -sum_interaction_count -silenceHour

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...