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")

 

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...