Dashboards & Visualizations

how to change display name in chart

avikc100
Path Finder

this is my splunk query:

index="webmethods_prd"  source="/apps/WebMethods/IntegrationServer/instances/default/logs/ExternalPACA.log" |eval timestamp=strftime(_time, "%F") | chart limit=30 count as count over source by timestamp

it is showing result as :

avikc100_0-1723565212163.png

but I want to add a custom name to it, how should I do that?

avikc100_4-1723565339839.png

 

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @avikc100 ,

you have to use the eval command to change the source value.

so you could use the case statment having many values:

| eval source=case(
     source="*PACA.log", "Canada Pricing Call",
     source="*second_value.log" "Second value",
     source="*third_value.log" "Third value")

Ciao.

Giuseppe

0 Karma

avikc100
Path Finder

I am getting blank value

avikc100_0-1723577433824.png

 

index="webmethods_prd" host="USPGH-WMA2AISP*" source="/apps/WebMethods/IntegrationServer/instances/default/logs/ExternalPAEU.log" ("success" OR "fail*")| eval status = if(searchmatch("success"), "Success", "Error")|stats count by source,status| xyseries source status count| eval source=case(
source="*PAEU.log", "Canada Pricing Call")
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @avikc100 ,

why did you used xyseries after stats?

please try:

index="webmethods_prd" host="USPGH-WMA2AISP*" source="/apps/WebMethods/IntegrationServer/instances/default/logs/ExternalPAEU.log" ("success" OR "fail*")
| eval status = if(searchmatch("success"), "Success", "Error")
| stats count by source status
| eval source=if(source="*PAEU.log", "Canada Pricing Call","XXX")

Ciao.

Giuseppe

0 Karma

avikc100
Path Finder

I am getting blank value

avikc100_0-1723577348133.png

index="webmethods_prd" host="USPGH-WMA2AISP*" source="/apps/WebMethods/IntegrationServer/instances/default/logs/ExternalPAEU.log" ("success" OR "fail*")| eval status = if(searchmatch("success"), "Success", "Error")|stats count by source,status| xyseries source status count| eval source=case(
source="*PACA.log", "Canada Pricing Call")
0 Karma
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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...