<?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: Token referencing another token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688347#M56366</link>
    <description>&lt;P&gt;I was afraid of that. It's no big deal, I can hand-jam in the hex code for each system.&lt;/P&gt;&lt;P&gt;Thanks for the response!&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2024 14:04:49 GMT</pubDate>
    <dc:creator>A_VA</dc:creator>
    <dc:date>2024-05-22T14:04:49Z</dc:date>
    <item>
      <title>Token referencing another token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688179#M56337</link>
      <description>&lt;P&gt;Morning, Splunkers.&lt;/P&gt;&lt;P&gt;I've got a dashboard that gets some of it's input from an external link. The input that comes in determines which system is being displayed by the dashboard with different settings through a &amp;lt;change&amp;gt; line in each, then shows the necessary information in a line graph.&lt;/P&gt;&lt;P&gt;That part is working perfectly, but what I'm trying to do is set the color of the line graph based on the system chosen, and I'm trying to keep is simple for future edits.&lt;/P&gt;&lt;P&gt;I've set the colors I'm currently using in the &amp;lt;init&amp;gt; section as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;init&amp;gt;
  &amp;lt;set token="red"&amp;gt;0xFF3333&amp;lt;/set&amp;gt;
  &amp;lt;set token="purple"&amp;gt;0x8833FF&amp;lt;/set&amp;gt;
  &amp;lt;set token="green"&amp;gt;0x00FF00&amp;lt;/set&amp;gt;
&amp;lt;/init&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The system selection looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;input token="system" depends="$NotDisplayed$"&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;condition value="System-A"&amp;gt;
      &amp;lt;set token="index_filter"&amp;gt;index_A&amp;lt;/set&amp;gt;
      &amp;lt;set token="display_name"&amp;gt;System-A&amp;lt;/set&amp;gt;
      &amp;lt;set token="color"&amp;gt;$purple$&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
    &amp;lt;condition value="System-B"&amp;gt;
      &amp;lt;set token="index_filter"&amp;gt;index_B&amp;lt;/set&amp;gt;
      &amp;lt;set token="display_name"&amp;gt;System-B&amp;lt;/set&amp;gt;
      &amp;lt;set token="color"&amp;gt;$green$&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
      &amp;lt;condition value="System-C"&amp;gt;
      &amp;lt;set token="index_filter"&amp;gt;index_C&amp;lt;/set&amp;gt;
      &amp;lt;set token="display_name"&amp;gt;System-C&amp;lt;/set&amp;gt;
      &amp;lt;set token="color"&amp;gt;$red$&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
  &amp;lt;/change&amp;gt;
&amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I now have a single query window putting up a line graph with the necessary information brought in from the eternal link. Like I said above, that part works perfectly, but what DOESN'T work is the color. Here's what my option field currently looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;option name="charting.fieldColors"&amp;gt;{"MyField":$color$}&amp;lt;/option&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea here is if I add future systems, I don't have to keep punching in hex codes for colors, I just enter a color name token. Unfortunately, what ends up happening is the line graph color is black, no matter what color I use. If I take the $color$ token out of the code and put in the hex code directly it works fine. It also works if I put the hex code directly in the system selection instead of the color name token.&lt;/P&gt;&lt;P&gt;Is there a trick to having a token reference another token in a dashboard? Or is this one of those "quit being fancy and do it the hard way" type of things?&lt;/P&gt;&lt;P&gt;Any help will be appreciated. Running Splunk 8.2.4, in case it matters.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 14:41:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688179#M56337</guid>
      <dc:creator>A_VA</dc:creator>
      <dc:date>2024-05-21T14:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Token referencing another token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688257#M56352</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/267753"&gt;@A_VA&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you try wrapping the color token in quotes as "&lt;SPAN&gt;$red|s$". I believe this should work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Relevant document:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.1/Viz/tokens#Syntax_to_consume_tokens" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.1/Viz/tokens#Syntax_to_consume_tokens&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;BR /&gt;Tejas.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the above solution helps, an upvote is appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 07:40:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688257#M56352</guid>
      <dc:creator>tej57</dc:creator>
      <dc:date>2024-05-22T07:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Token referencing another token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688262#M56354</link>
      <description>&lt;P&gt;iirc this part of the SimpleXML is not re-evaluated after the dashboard is loaded, therefore the tokens can't be used here. iirc, the way approached this is to use CSS where tokens are evaluated. The trick with using CSS is identifying the element you want to change the style of so depending on how dynamic your charts are or how different they are for each system, this may prove to be quite tricky!&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 08:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688262#M56354</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-05-22T08:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Token referencing another token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688345#M56365</link>
      <description>&lt;P&gt;Sadly, no, that didn't work. No biggie, I can hand-jam in the hex code for each system, I was just hoping to get a little too fancy.&lt;/P&gt;&lt;P&gt;Thanks, though!&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 14:03:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688345#M56365</guid>
      <dc:creator>A_VA</dc:creator>
      <dc:date>2024-05-22T14:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Token referencing another token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688347#M56366</link>
      <description>&lt;P&gt;I was afraid of that. It's no big deal, I can hand-jam in the hex code for each system.&lt;/P&gt;&lt;P&gt;Thanks for the response!&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 14:04:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Token-referencing-another-token/m-p/688347#M56366</guid>
      <dc:creator>A_VA</dc:creator>
      <dc:date>2024-05-22T14:04:49Z</dc:date>
    </item>
  </channel>
</rss>

