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!

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...

Auto-Injector for Everything Else: Making OpenTelemetry Truly Universal

You might have seen Splunk’s recent announcement about donating the OpenTelemetry Injector to the ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...