Splunk Search

Can we find the events which are not matched by Lookup table?

maria2691
Path Finder

I have a lookup table with which I am categorizing the Error Messages received from a particulat Sourcetype "error".
Below is the SPL query that I have used to categorize the Error Messages:
sourcetype=error
| lookup Error_Wildcards "ErrorMessage" AS "Error Description" output "ErrorType" as "Error Type"
| stats count(Robot) as "Number Of Robots with Error" by "Error Type"
| table "Error Type", "Number Of Robots with Error"

I need to retrieve the Events which are not matched with the Lookup Table and categorize them as "Not Categorized".
Is it possible in any way by modifying the Lookup CSV file or by modifying the search query? Please Suggest!

Thanks
Maria Arokiaraj

Tags (1)
0 Karma
1 Solution

micahkemp
Champion

Try:

sourcetype=error 
| lookup Error_Wildcards "ErrorMessage" AS "Error Description" output "ErrorType" as "Error Type"
| eval "Error Type"=if(isnull('Error Type'), "Not Categorized", 'Error Type')
| stats count(Robot) as "Number Of Robots with Error" by "Error Type" 
| table "Error Type", "Number Of Robots with Error"

View solution in original post

micahkemp
Champion

Try:

sourcetype=error 
| lookup Error_Wildcards "ErrorMessage" AS "Error Description" output "ErrorType" as "Error Type"
| eval "Error Type"=if(isnull('Error Type'), "Not Categorized", 'Error Type')
| stats count(Robot) as "Number Of Robots with Error" by "Error Type" 
| table "Error Type", "Number Of Robots with Error"

maria2691
Path Finder

Thanks @micahkemp 🙂
It worked.

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