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!

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