<?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 Re: In a dashboard panel, how do I make a conditional title based on a token value? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/394104#M25774</link>
    <description>&lt;P&gt;Simple. Add a &lt;CODE&gt;change&lt;/CODE&gt; event to your input like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="sourcetype_tok"&amp;gt;
  &amp;lt;...&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;condition value="*"&amp;gt;
      &amp;lt;set token="display_domain_names"&amp;gt;Unfiltered&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
    &amp;lt;condition value="*"&amp;gt;
      &amp;lt;set token="display_domain_names"&amp;gt;$value$&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
  &amp;lt;/change&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should make your input set a second token &lt;CODE&gt;display_domain_names&lt;/CODE&gt; which contains the text "Unfiltered" if the user selects the "all" option or the selected value if another one is selected. Use this token in your title. If label and value are different in the dropdown and label is nicer, you also have &lt;CODE&gt;$label$&lt;/CODE&gt; available. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#change_.28form_input.29"&gt;Docs here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Nov 2018 14:07:16 GMT</pubDate>
    <dc:creator>jeffland</dc:creator>
    <dc:date>2018-11-15T14:07:16Z</dc:date>
    <item>
      <title>How do I make a conditional title based on a token value in a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/394103#M25773</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I have a chart that shows data based on a variable &lt;CODE&gt;$sourcetype_tok$&lt;/CODE&gt;. The values of the dropdown list are as follows:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;A list of categories from a query&lt;/LI&gt;
&lt;LI&gt;A static one that has the name &lt;CODE&gt;all&lt;/CODE&gt; and the value &lt;CODE&gt;*&lt;/CODE&gt; that should represent all the categories combined&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;However, the chart's title should depend on the selected category. Until now, I have this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;title&amp;gt;
    Top 10: $sourcetype_tok$ domains
&amp;lt;/title&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the selected category is &lt;CODE&gt;A&lt;/CODE&gt;, it works.&lt;/P&gt;
&lt;P&gt;However, if I select the value &lt;CODE&gt;all&lt;/CODE&gt;, the title will be &lt;CODE&gt;Top 10: * domains&lt;/CODE&gt; and I want it to be customizable. Is there a way I can insert fields such as &lt;CODE&gt;&amp;lt;title&amp;gt;&lt;/CODE&gt; conditionally? Or can I do something so the title would depend on the value of a token?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 17:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/394103#M25773</guid>
      <dc:creator>orinciog</dc:creator>
      <dc:date>2022-02-16T17:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard panel, how do I make a conditional title based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/394104#M25774</link>
      <description>&lt;P&gt;Simple. Add a &lt;CODE&gt;change&lt;/CODE&gt; event to your input like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="sourcetype_tok"&amp;gt;
  &amp;lt;...&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;condition value="*"&amp;gt;
      &amp;lt;set token="display_domain_names"&amp;gt;Unfiltered&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
    &amp;lt;condition value="*"&amp;gt;
      &amp;lt;set token="display_domain_names"&amp;gt;$value$&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
  &amp;lt;/change&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should make your input set a second token &lt;CODE&gt;display_domain_names&lt;/CODE&gt; which contains the text "Unfiltered" if the user selects the "all" option or the selected value if another one is selected. Use this token in your title. If label and value are different in the dropdown and label is nicer, you also have &lt;CODE&gt;$label$&lt;/CODE&gt; available. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#change_.28form_input.29"&gt;Docs here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 14:07:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/394104#M25774</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2018-11-15T14:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard panel, how do I make a conditional title based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/394105#M25775</link>
      <description>&lt;P&gt;Exactly what I needed!&lt;BR /&gt;
Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 14:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/394105#M25775</guid>
      <dc:creator>orinciog</dc:creator>
      <dc:date>2018-11-15T14:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard panel, how do I make a conditional title based on a token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/585401#M47983</link>
      <description>&lt;P&gt;Same question, just wonder how do you insert the &amp;lt;change&amp;gt;&lt;/P&gt;&lt;P&gt;Bec I also want to change the title based on the token condition, but &amp;lt;title&amp;gt; is not &amp;lt;input&amp;gt;, I do not find the correction to insert the &amp;lt;change&amp;gt; code&lt;/P&gt;&lt;P&gt;My goal is also to replace the * with ALL, thanks for support!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 17:13:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/585401#M47983</guid>
      <dc:creator>Vachel</dc:creator>
      <dc:date>2022-02-16T17:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a conditional title based on a token value in a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/585876#M48031</link>
      <description>&lt;P&gt;Hi, I would appreciated if any expert could show your experience:&lt;/P&gt;&lt;P&gt;I want my title shows&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ALL Status&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;when * Status is showed, now I have set a second token as&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;title&amp;gt;$displaykeystorestatus$ Status Overview&amp;lt;/title&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;if part of type is selected, then should show a certain type&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;title&amp;gt;$form.type$ Status Overview&amp;lt;/title&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Now either of them can be achieved separately, but I cannot make the title into the conditional one,&amp;nbsp; could you help to share how to use the &amp;lt; change&amp;gt; and &amp;lt;condition&amp;gt; to combine these two scenarios? Many thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Feb 2022 21:50:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-conditional-title-based-on-a-token-value-in-a/m-p/585876#M48031</guid>
      <dc:creator>Vachel</dc:creator>
      <dc:date>2022-02-20T21:50:20Z</dc:date>
    </item>
  </channel>
</rss>

