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!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...