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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...