Splunk Search

help to legend field name after using a lookup correspondance

jip31
Motivator

hi

I use a lookup in order to do a correspondance between the field web_error_code which is my sourcetype and which is an error code and the name of th error code

It works perfectly but I just need to complete the legend timechart with the original web_error code

for example I need "400 - Bad gateway", actually I have just bad gateway

How to do this please

 

index=toto sourcetype=tutu web_domain="*"   
| lookup HttpCode.csv status as web_error_code output status_description 
| timechart span=1d  sum(web_error_count) as web_error_count by status_description 

 

 

Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Create a field that combines the code with the description then use that field in the timechart.

index=toto sourcetype=tutu web_domain="*"   
| lookup HttpCode.csv status as web_error_code output status_description 
| eval code_description = web_error_code . " - " . status_description
| timechart span=1d  sum(web_error_count) as web_error_count by code_description
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Create a field that combines the code with the description then use that field in the timechart.

index=toto sourcetype=tutu web_domain="*"   
| lookup HttpCode.csv status as web_error_code output status_description 
| eval code_description = web_error_code . " - " . status_description
| timechart span=1d  sum(web_error_count) as web_error_count by code_description
---
If this reply helps you, Karma would be appreciated.
0 Karma

jip31
Motivator

perfect thanks

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...