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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...