Knowledge Management

How to use priority of EventTypes as criteria ?

woodreamz
New Member

Hello,

I have configured Event Types in Splunk to identify all errors with a tag (it's easier to understand than stacktrace).
But I would like to make queries on the Event type priority (if its possible).

Example: ("ERROR-" OR "WARN-") AND priority=1

Anyone knows how to do that ?

Thx

Tags (2)
0 Karma
1 Solution

hazekamp
Builder

Woodreamz,

Eventtype priority in eventtypes.conf is not a searchable element.

priority = <integer, 1 through 10>
* Value used to determine the order in which the matching eventtypes of an event are displayed.  
* 1 is the highest and 10 is the lowest priority. 

Instead, I would recommend creating a lookup which maps eventtype or other event characteristics to a priority field. Example:

## eventtypes.conf
[myeventtype]
search = ERROR OR WARN

## transforms.conf
[eventtype_priority_lookup]
filename = eventtype_priorities.csv

## eventtype_priorities.csv
eventtype,priority
myeventtype,super-critical

## search
ERROR OR WARN | lookup eventtype_priority_lookup eventtype OUTPUT priority | search priority=super-critical

The only downside to performing a lookup on eventtype is that the eventtype field is not available until after the initial search. So we perform an initial search to narrow down our events, then perform the lookup, and then perform a search on the output field of the lookup. You could not use this lookup in props.conf for instance.

You could also use tags for this, however tags can be a bit cumbersome to report on as a field.

##tags.conf
[eventtype=myeventtype]
super-critical = enabled

## search
tag=super-critical 

View solution in original post

0 Karma

hazekamp
Builder

Woodreamz,

Eventtype priority in eventtypes.conf is not a searchable element.

priority = <integer, 1 through 10>
* Value used to determine the order in which the matching eventtypes of an event are displayed.  
* 1 is the highest and 10 is the lowest priority. 

Instead, I would recommend creating a lookup which maps eventtype or other event characteristics to a priority field. Example:

## eventtypes.conf
[myeventtype]
search = ERROR OR WARN

## transforms.conf
[eventtype_priority_lookup]
filename = eventtype_priorities.csv

## eventtype_priorities.csv
eventtype,priority
myeventtype,super-critical

## search
ERROR OR WARN | lookup eventtype_priority_lookup eventtype OUTPUT priority | search priority=super-critical

The only downside to performing a lookup on eventtype is that the eventtype field is not available until after the initial search. So we perform an initial search to narrow down our events, then perform the lookup, and then perform a search on the output field of the lookup. You could not use this lookup in props.conf for instance.

You could also use tags for this, however tags can be a bit cumbersome to report on as a field.

##tags.conf
[eventtype=myeventtype]
super-critical = enabled

## search
tag=super-critical 
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...