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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...