Knowledge Management

Exclusion in lookup via wildcard

viku7474
Explorer

I have a splunk query which returns these 2 set of events.

1) domain_name="abc"
microservice_name="test"
message=[WEB] ERROR RESPONSE : NO_DOCUMENTS_FOUND ->

2) domain_name="abc"
microservice_name="test"
message=[WEB] ERROR RESPONSE : GUID_EXPIRED

my vtest.csv lookup looks like below:
domain_name; microservice_name; message
abc; test;  NO_DOCUMENTS_FOUND

viku7474_0-1716831429130.png


I am using the below query to exclude 1st set of events. I have created WILDCARD(message) match_type 

| lookup vtest message OUTPUT message as exclude_message
| search NOT (exclude_message="*")



But it is not working, and I don't get any fields in "exclude_message" as well. kindly help. 

 

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @viku7474 ,

please try this:

<your_search>
NOT [ | inputlookup vtest | rename message AS query | fields quey ]

in this way you perform a full text search in the main search using the lookup's message values.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @viku7474 ,

please try this:

<your_search>
NOT [ | inputlookup vtest | rename message AS query | fields quey ]

in this way you perform a full text search in the main search using the lookup's message values.

Ciao.

Giuseppe

richgalloway
SplunkTrust
SplunkTrust

Please explain what is meant by "it is not working".  What results do you get and how do they not meet your expectations?

The exclude_message field will be null if the lookup fails to find a match.

---
If this reply helps you, Karma would be appreciated.
0 Karma

viku7474
Explorer

I want to exclude the first set of events and retain the 2nd set of events, via lookup,
when I use the search NOT condition, it doesn't work as expected. 

you're right, exclude_message, there is no field as such is getting created. 

0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...