<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Set a token name based on the value? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Set-a-token-name-based-on-the-value/m-p/527444#M35796</link>
    <description>&lt;P&gt;Is it possible to dynamically set a token name to show/hide panels, based on the value of the input?&lt;/P&gt;&lt;P&gt;I have a dashboard with panels that are specific to certain applications, but irrelevant to others. I want to hide the irrelevant panels when they don't apply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Such as:&lt;/P&gt;&lt;P&gt;&amp;lt;input type="text" searchWhenChanged="true" &amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;default&amp;gt;$service_name$&amp;lt;/default&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;change&amp;gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;set token="view_$value$"&amp;gt;&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/change&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;/P&gt;&lt;P&gt;Results in: "&lt;SPAN&gt;Invalid token name: "viewxml_$value$""&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Im trying to NOT hard-code service names, because there are many, with a &amp;lt;condition&amp;gt; if possible.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 01 Nov 2020 13:15:49 GMT</pubDate>
    <dc:creator>timgren</dc:creator>
    <dc:date>2020-11-01T13:15:49Z</dc:date>
    <item>
      <title>Set a token name based on the value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Set-a-token-name-based-on-the-value/m-p/527444#M35796</link>
      <description>&lt;P&gt;Is it possible to dynamically set a token name to show/hide panels, based on the value of the input?&lt;/P&gt;&lt;P&gt;I have a dashboard with panels that are specific to certain applications, but irrelevant to others. I want to hide the irrelevant panels when they don't apply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Such as:&lt;/P&gt;&lt;P&gt;&amp;lt;input type="text" searchWhenChanged="true" &amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;default&amp;gt;$service_name$&amp;lt;/default&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;change&amp;gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;set token="view_$value$"&amp;gt;&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/change&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;/P&gt;&lt;P&gt;Results in: "&lt;SPAN&gt;Invalid token name: "viewxml_$value$""&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Im trying to NOT hard-code service names, because there are many, with a &amp;lt;condition&amp;gt; if possible.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 13:15:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Set-a-token-name-based-on-the-value/m-p/527444#M35796</guid>
      <dc:creator>timgren</dc:creator>
      <dc:date>2020-11-01T13:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set a token name based on the value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Set-a-token-name-based-on-the-value/m-p/527488#M35800</link>
      <description>&lt;P&gt;I don't have access to javascript so I haven't tried this out, but maybe it will inspire you or others to try something like this.&lt;/P&gt;&lt;P&gt;Tokens can be passed as parameters on the dashboard URL. You could add a parameter token to the URL and use it as a token in your dashboard (I have tried this part by just changing my address URL in my browser).&lt;/P&gt;&lt;P&gt;In the worse case, you may be able to use a drilldown to call your dashboard with the required tokens included in the URL. This will trigger a reload of your dashboard which may not be ideal.&lt;/P&gt;&lt;P&gt;The interesting idea is to perhaps use javascript to modify the current document parameters so that a reload is not required. Maybe look&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/38759563/modify-a-parameter-in-url-with-page-reload-using-js-jquery" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;for some ideas.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 08:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Set-a-token-name-based-on-the-value/m-p/527488#M35800</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-02T08:39:51Z</dc:date>
    </item>
  </channel>
</rss>

