Dashboards & Visualizations

splunk token value asterisk in title

venky1544
Builder

Hi 

i'm using a drop down option in which i  have a static option ALL and value =*  the drop down optin is for different environment ALL ,DEV,QA,PROD and i have a table where hosts are populated based on environment

the issues is in the title of the panel  when i select ALL the title of the panel shows * hosts per environment  for other DEV QA and PROD its working fine

How can i replace the * with ALL in the title of the panel

    

Labels (1)
0 Karma

venky1544
Builder

Hi 

I tried using the change and condition option i created another token pan1 but how should i use it in the title panel as $env$ token is being used in both title and search query and i can't unset env token 

<input type="dropdown" token="env" searchWhenChanged="true">
<label>ENV</label>
<fieldForLabel>ENV</fieldForLabel>
<fieldForValue>ENV</fieldForValue>
<search>
<query>index=testdata" |eval ENV=case(host LIKE "%tvap%","TEST",host LIKE "%qqap%","QA",host LIKE "%ppap%","PROD",host LIKE "%ccap%","CAT")|stats count by ENV</query>
<earliest>-4h@m</earliest>
<latest>now</latest>
</search>
<default>*</default>
<initialValue>*</initialValue>
<choice value="*">ALL</choice>
<change>
<condition value="*">
<set token="pan1">ALL</set>
</condition>
</change>
</input>

 

and the title panel  

<panel >
<table>
<title>$pan1$ $env$ Environment PATCH STATUS </title>
<search>

0 Karma

richgalloway
SplunkTrust
SplunkTrust

When I said to use a different token in the title, I meant to use it instead of the current one.  If the selection is not "*" then set pan1 to env.

<change>
  <condition value="*">
    <set token="pan1">ALL</set>
  </condition>
  <condition value="TEST">
    <set token="pan1">TEST</set>
  </condition>
  <condition value="QA">
    <set token="pan1">QA</set>
  </condition>
  <condition value="PROD">
    <set token="pan1">PROD</set>
  </condition>
  <condition value="CAT">
    <set token="pan1">CAT</set>
  </condition>
</change>

I don't know of a way to do an "else" clause with <condition>.

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use a different token in the title of the panel.  Use a <condition> statement to set the new token to "ALL" if the input token is "*".

---
If this reply helps you, Karma would be appreciated.
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Use the change event handler on the dropdown to set an additional token with ALL if * has been selected.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...