Dashboards & Visualizations

splunk token value asterisk in title

venky1544
Explorer

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
Explorer

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, an upvote 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, an upvote 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
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!