Getting Data In

How to exclude Host using Inputlookup?

karthi2809
Builder

index=bp_prod NOT ([|inputlookup serverBP.csv|fields Servers Status |where Status=="N"] ) |eventstats count as "totalCount" | eventstats count as "choiceCount" by host| eval percent=(choiceCount/totalCount)*100 | stats values(choiceCount) as Count , values(percent) as Percentage by host

In my serverBP.csv i have following coloumn:

Servers Status

server1 Y
server2 Y
server3 N

I have to exclude server 3 in my query

0 Karma

DalJeanis
Legend

Change the subsearch to output only the server name for the servers with status N, and rename the field name to whatever the field will be called on the other index...

[|inputlookup serverBP.csv | where Status=="N"| table Servers | rename Servers as host]

You can see what the output of the implicit format command will be -- that is, what will be returned by the square brackets -- by running the search independently, and piping it to the explicit format command....

 |inputlookup serverBP.csv | where Status=="N"| table Servers | rename Servers as host | format

...which in this case will probably look like...

(host="server3")
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...