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 | When is October more than just the tenth month?

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

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 & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...