Splunk Search

How to add severity to fetched errors messages?

PraveenThakur
Engager

Hi All,

I am trying to add severity column to output of first command, could you please let me know how to do it.

Query I have created is :

index=abc source=xyz | table _time ID STATUS ERROR_Name
| search ERROR_Name IN
("EndDate must be after StartDate""The following is required: PersonName" ....many others)
| join type=inner ID[search index=abc source=xyz STATUS IN (FATAL,SUCCESS)
| table _time ID STATUS
| stats latest(STATUS) as STATUS by ID
| search STATUS IN (FATAL) | fields ID]
| stats latest(STATUS) as STATUS by ID ERROR_Name
| search STATUS IN (FATAL) | top 50 ERROR_Name | appendcols [| eval severity = case(ERROR_Name=="EndDate must be after StartDate", "One", ERROR_Name=="The following is required: PersonName", "two")]

Labels (2)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

appendcols is not the answer in so many cases - just create a new field (column) with the eval command

index=abc source=xyz | table _time ID STATUS ERROR_Name
| search ERROR_Name IN
("EndDate must be after StartDate""The following is required: PersonName" ....many others)
| join type=inner ID[search index=abc source=xyz STATUS IN (FATAL,SUCCESS)
| table _time ID STATUS
| stats latest(STATUS) as STATUS by ID
| search STATUS IN (FATAL) | fields ID]
| stats latest(STATUS) as STATUS by ID ERROR_Name
| search STATUS IN (FATAL) | top 50 ERROR_Name 
| eval severity = case(ERROR_Name=="EndDate must be after StartDate", "One", ERROR_Name=="The following is required: PersonName", "two")

 

View solution in original post

PraveenThakur
Engager

Thanks a lot it has solved my problem

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

appendcols is not the answer in so many cases - just create a new field (column) with the eval command

index=abc source=xyz | table _time ID STATUS ERROR_Name
| search ERROR_Name IN
("EndDate must be after StartDate""The following is required: PersonName" ....many others)
| join type=inner ID[search index=abc source=xyz STATUS IN (FATAL,SUCCESS)
| table _time ID STATUS
| stats latest(STATUS) as STATUS by ID
| search STATUS IN (FATAL) | fields ID]
| stats latest(STATUS) as STATUS by ID ERROR_Name
| search STATUS IN (FATAL) | top 50 ERROR_Name 
| eval severity = case(ERROR_Name=="EndDate must be after StartDate", "One", ERROR_Name=="The following is required: PersonName", "two")

 

Get Updates on the Splunk Community!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...