Dashboards & Visualizations

Add Dynamic Title to my Dashboard Panel Based on MultiSelect Input

katzr
Path Finder

Hello I am trying to make my dashboard panel title dynamic and display the Region and Country. Example the user selects North America and United States- I want the title to be that. Below is my code- can you help me edit this with conditions to create a dynamic title that changes as the filters change.

</input>
<input type="multiselect" searchWhenChanged="true" token="region">
  <label>Region</label>
  <prefix>(</prefix>
  <suffix>)</suffix>
  <valuePrefix>Region="</valuePrefix>
  <valueSuffix>"</valueSuffix>
  <delimiter> OR </delimiter>
  <choice value="*">All</choice>
  <choice value="ASIA">ASIA</choice>
  <choice value="EUROPE">EUROPE</choice>
  <choice value="IMEA">IMEA</choice>
  <choice value="NORTH AMERICA">NORTH AMERICA</choice>
  <choice value="LATIN AMERICA">LATIN AMERICA</choice>
  <choice value="UNKNOWN">UNKNOWN</choice>
  <default>*</default>
  <initialValue>*</initialValue>
</input>
<input type="multiselect" searchWhenChanged="true" token="country">
  <label>Country</label>
  <prefix>(</prefix>
  <suffix>)</suffix>
  <valuePrefix>Country="</valuePrefix>
  <valueSuffix>"</valueSuffix>
  <delimiter> OR </delimiter>
  <choice value="*">All</choice>
  <search>
    <query>| inputlookup CurrentSiteInfoCountry.csv | search $region$ | stats count by Country</query>
    <earliest>-15m</earliest>
    <latest>now</latest>
  </search>
  <fieldForLabel>Country</fieldForLabel>
  <fieldForValue>Country</fieldForValue>
  <default>*</default>
</input>
0 Karma

sbbadri
Motivator
<form>
  <label>titletoken</label>
  <fieldset submitButton="false">
    <input type="multiselect" searchWhenChanged="true" token="region">
      <label>Region</label>
      <prefix>(</prefix>
      <suffix>)</suffix>
      <valuePrefix>Region="</valuePrefix>
      <valueSuffix>"</valueSuffix>
      <delimiter> OR </delimiter>
      <choice value="*">All</choice>
      <choice value="ASIA">ASIA</choice>
      <choice value="EUROPE">EUROPE</choice>
      <choice value="IMEA">IMEA</choice>
      <choice value="NORTH AMERICA">NORTH AMERICA</choice>
      <choice value="LATIN AMERICA">LATIN AMERICA</choice>
      <choice value="UNKNOWN">UNKNOWN</choice>
      <default>*</default>
      <initialValue>*</initialValue>
    </input>

  </fieldset>
  <row>
    <panel>
      <title>$region$</title>
      <event>
        <search>
          <query>index=_internal |head 1</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
      </event>
    </panel>
  </row>
</form>
0 Karma

katzr
Path Finder

@sbbadri This displays (Region="*") or (Region="NORTH AMERICA") - I just want to display the label like All or NORTH AMERICA. I'm pretty sure I have to use conditions for the labels but I can't figure out how to get it to work.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...