Splunk Search

Detailed search for the triggered alerts in Splunk

szukacz
Engager

Hi team,

I'm trying to build a search which will search for the alerts which have been triggered for a hosts during specific period of time,  which are in the lookup and ideally I to show the results with below:

- hostname

- decription of the alert

- when alert was triggered

I would appreciate any guide or assistance. 

 

Kind regards

Labels (1)
Tags (3)
0 Karma

aasabatini
Motivator

Hi @szukacz 

let me know if this search works for your case

| rest /servicesNS/-/-/saved/searches 
| search title="*" 
| rename dispatch.earliest_time AS "frequency", title AS "title", eai:acl.app AS "app", next_scheduled_time AS "nextRunTime", search AS "query", updated AS "lastUpdated", action.email.to AS "emailTo", action.email.cc AS "emailCC", action.email.subject AS "emailSubject", alert.severity AS "SEV" 
| eval severity=case(SEV == "5", "Critical-5", SEV == "4", "High-4",SEV == "3", "Warning-3",SEV == "2", "Low-2",SEV == "1", "Info-1") 
| table title lastUpdated, nextRunTime, emailTo action.lookup.filename, query, severity
| fillnull value="" 
| sort -lastUpdated
“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”

szukacz
Engager

Thank you so much for this search, it works great. Can we tune it to extract the hostname from the alert or can we use lookup list to filter only hosts on that list? 

0 Karma

aasabatini
Motivator

Hi @szukacz 

| rest /servicesNS/-/-/saved/searches 
| search title="*"| rename dispatch.earliest_time AS "frequency", title AS "title", eai:acl.app AS "app", next_scheduled_time AS "nextRunTime", search AS "query", updated AS "lastUpdated", action.email.to AS "emailTo", action.email.cc AS "emailCC", action.email.subject AS "emailSubject", alert.severity AS "SEV" 
| eval severity=case(SEV == "5", "Critical-5", SEV == "4", "High-4",SEV == "3", "Warning-3",SEV == "2", "Low-2",SEV == "1", "Info-1") 
| table title lastUpdated, nextRunTime, emailTo action.lookup.filename, query, severity, splunk_server
| fillnull value="" 
| sort -lastUpdated

if this search help karma point and confirmation solution is appreciated

Regards

Alessandro

“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...