<?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: Multiselect choice value dynamic from token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399773#M26195</link>
    <description>&lt;P&gt;Splunk 6.5.2&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 12:48:49 GMT</pubDate>
    <dc:creator>altink</dc:creator>
    <dc:date>2018-09-26T12:48:49Z</dc:date>
    <item>
      <title>Multiselect choice value dynamic from token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399768#M26190</link>
      <description>&lt;P&gt;Dear All&lt;/P&gt;

&lt;P&gt;Is it possible to have the value of two or more  choice values of a multi-select dynamic, from tokens, ex initialized on the form.&lt;BR /&gt;
in the&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="multiselect" token="field3"&amp;gt;
      &amp;lt;label&amp;gt;field3&amp;lt;/label&amp;gt;
      &amp;lt;choice value="aaa"&amp;gt;Choice1&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="bbb"&amp;gt;Choice2&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="ccc"&amp;gt;Choice3&amp;lt;/choice&amp;gt;
     &amp;lt;choice value="ddd"&amp;gt;Choice4&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
  replace the third Choice with:

&amp;lt;choice value=$token1$&amp;gt;Choice3&amp;lt;/choice&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where token1 is a variable that has been initialized on top of the form.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;init&amp;gt;
    &amp;lt;set token="token1"&amp;gt;value&amp;lt;/set&amp;gt;
   &amp;lt;set token="token2"&amp;gt;value&amp;lt;/set&amp;gt;
  &amp;lt;/init&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the fourth choice with token2.&lt;/P&gt;

&lt;P&gt;Using the way  above, I received a syntax error in the editor - "Unquoted attribute value"&lt;BR /&gt;
If I do quote, then I have the quoted string and not the token value.&lt;/P&gt;

&lt;P&gt;please advise&lt;/P&gt;

&lt;P&gt;best regards&lt;BR /&gt;
Altin&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 20:17:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399768#M26190</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2018-09-25T20:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect choice value dynamic from token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399769#M26191</link>
      <description>&lt;P&gt;Do you need it to be part of the static options? You can use a token in the dynamic portion of the multi-select options:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;init&amp;gt; &amp;lt;set token="token_test1"&amp;gt; "tester1" &amp;lt;/set&amp;gt;&amp;lt;/init&amp;gt;

...

    &amp;lt;input type="multiselect" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;choice value="1"&amp;gt;aaa&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="2"&amp;gt;bbb&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="3"&amp;gt;ccc&amp;lt;/choice&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;token_value&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;token_value&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;|localop| stats count | eval count = $token_test1$ | rename count AS token_value&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This populates with the token and token value.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 20:51:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399769#M26191</guid>
      <dc:creator>zonistj</dc:creator>
      <dc:date>2018-09-25T20:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect choice value dynamic from token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399770#M26192</link>
      <description>&lt;P&gt;thank you very much for the answer.&lt;/P&gt;

&lt;P&gt;I think there is a problem here. I need to have a Choice4 as label.&lt;BR /&gt;
I did replace the code&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldForLabel&amp;gt;Choice4&amp;lt;/fieldForLabel&amp;gt;
&amp;lt;fieldForValue&amp;gt;token_value&amp;lt;/fieldForValue&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but I keep having tester1 (the value), instead of the needed caption Choice4&lt;/P&gt;

&lt;P&gt;best regards&lt;BR /&gt;
Altin&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 21:31:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399770#M26192</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2018-09-25T21:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect choice value dynamic from token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399771#M26193</link>
      <description>&lt;P&gt;You have to change "fieldForLabel" and "fieldForValue" to  whatever you're passing for your token. Essentially, they should both be set to whatever you rename your field to in the dynamic search query.&lt;/P&gt;

&lt;P&gt;If you want it to be Choice4 then it should look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;init&amp;gt; &amp;lt;set token="choice_four"&amp;gt; "4" &amp;lt;/set&amp;gt;&amp;lt;/init&amp;gt;

 ...

     &amp;lt;input type="multiselect" token="field1"&amp;gt;
       &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
       &amp;lt;choice value="1"&amp;gt;Choice1&amp;lt;/choice&amp;gt;
       &amp;lt;choice value="2"&amp;gt;Choice2&amp;lt;/choice&amp;gt;
       &amp;lt;choice value="3"&amp;gt;Choice3&amp;lt;/choice&amp;gt;
       &amp;lt;fieldForLabel&amp;gt;Choice4&amp;lt;/fieldForLabel&amp;gt;
       &amp;lt;fieldForValue&amp;gt;Choice4&amp;lt;/fieldForValue&amp;gt;
       &amp;lt;search&amp;gt;
         &amp;lt;query&amp;gt;|localop| stats count | eval count = $choice_four$ | rename count AS Choice4&amp;lt;/query&amp;gt;
         &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
         &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
       &amp;lt;/search&amp;gt;
     &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2018 22:04:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399771#M26193</guid>
      <dc:creator>zonistj</dc:creator>
      <dc:date>2018-09-25T22:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect choice value dynamic from token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399772#M26194</link>
      <description>&lt;P&gt;The problem persists, I have 4 (the value) listed in the drop-down, instead of label - Choice4.&lt;/P&gt;

&lt;P&gt;below is the code as by your proposal:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;init&amp;gt;
    &amp;lt;set token="choice_four"&amp;gt;"4"&amp;lt;/set&amp;gt;
  &amp;lt;/init&amp;gt;
.......................................

    &amp;lt;input type="multiselect" token="field3"&amp;gt;
      &amp;lt;label&amp;gt;field3&amp;lt;/label&amp;gt;
      &amp;lt;choice value="aaa"&amp;gt;Choice1&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="bbb"&amp;gt;Choice2&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="ccc"&amp;gt;Choice3&amp;lt;/choice&amp;gt;

       &amp;lt;fieldForLabel&amp;gt;Choice4&amp;lt;/fieldForLabel&amp;gt;
       &amp;lt;fieldForValue&amp;gt;Choice4&amp;lt;/fieldForValue&amp;gt;
       &amp;lt;search&amp;gt;
         &amp;lt;query&amp;gt;|localop| stats count | eval count = $choice_four$ | rename count AS Choice4&amp;lt;/query&amp;gt;
       &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;best regards,&lt;BR /&gt;
Altin&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 12:47:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399772#M26194</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2018-09-26T12:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect choice value dynamic from token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399773#M26195</link>
      <description>&lt;P&gt;Splunk 6.5.2&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 12:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399773#M26195</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2018-09-26T12:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect choice value dynamic from token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399774#M26196</link>
      <description>&lt;P&gt;the search itself&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;localop | stats count | eval count = 4 | rename count AS Choice4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where  $choice_four$ has been replaced with its value 4, performs correctly. It returns a single column named Choice4, single row, value 4.&lt;/P&gt;

&lt;P&gt;Looks the problem is in the multiselect.&lt;/P&gt;

&lt;P&gt;best regards&lt;BR /&gt;
Altin&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 13:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399774#M26196</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2018-09-26T13:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect choice value dynamic from token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399775#M26197</link>
      <description>&lt;P&gt;Please forgive me for not explaining in full my idea originally. I was not that clear myself.&lt;BR /&gt;
What I need to do with the multi-select is to have Captions that will lead to "values", the later being instead search strings that I will add, if selected, to the "base" one.&lt;BR /&gt;
That is why I edited the question to ask for least two dynamic options, instead of the original one.&lt;/P&gt;

&lt;P&gt;best regards&lt;BR /&gt;
Altin&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 13:22:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-choice-value-dynamic-from-token/m-p/399775#M26197</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2018-09-26T13:22:46Z</dc:date>
    </item>
  </channel>
</rss>

