Splunk Search

Server Availability query from Incident data

samn123
New Member

I have a lookup table with fields Application name and host, and i have a realtime Incident data with index, sourcetype and ServerName. I have two things to be retrieved.
1. If there is a incident created with ServerName matching the host in the lookup table and the Summary field as Server down then display the result as Down
2. if there is no incident ticket created for the host then the result should always show as UP ( meaning by default the result should be UP for last 60 mins unless we have a ticket with above criteria)
below is the query which i tried but it is showing the result only when there are any relevant data in the index

| inputlookup ServerFile
| rename "host" as "ServerName"
| join type=inner ServerName
[ search index=Data sourcetype="incidents"
| eval Result=if(SHORT_DESCRIPTION like "host Down%", "DOWN","UP")
| table ServerName Result]

Tags (1)
0 Karma

woodcock
Esteemed Legend

Do not SQL when you Splunk. Forget about join entirely; when you think join type=inner, you should think | lookup:

index=*Data* sourcetype="incidents" 
| lookup ServerFile host AS ServerName
| eval Result=if(SHORT_DESCRIPTION like "host Down%", "DOWN","UP") 
| table ServerName Result
0 Karma

koshyk
Super Champion

Please try something like

| inputlookup ServerFile.csv 
| rename host as ServerName
| join type=left ServerName 
    [ search index=Data sourcetype="incidents" | fields SHORT_DESCRIPTION,ServerName]
| eval Result=if(SHORT_DESCRIPTION like "host Down%", "DOWN","UP") 
| table ServerName Result
0 Karma

tom_frotscher
Builder

Hi,

if you want a result for every host in your lookup, you need to change the join type to outer. This will show every entry from the main search (your inputlookup) even if it does not find a match in the subsearch (your incident data).

There is a nice image in the documentation, that shows how the types of join works: https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Join#Optional_arguments

So you need to make sure to have all known hosts into your lookup table.

0 Karma
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 ...