<?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: Setting token for a dropdwn with a search and init in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476224#M31303</link>
    <description>&lt;P&gt;Ok this works fine !&lt;BR /&gt;
Thanks a lot!&lt;BR /&gt;
How can I accept this as ansswer ??&lt;/P&gt;</description>
    <pubDate>Wed, 15 Apr 2020 10:34:18 GMT</pubDate>
    <dc:creator>fabrizioalleva</dc:creator>
    <dc:date>2020-04-15T10:34:18Z</dc:date>
    <item>
      <title>Setting token for a dropdwn with a search and init</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476220#M31299</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I'm trying from an initial search to put the value into a token to use it as a default initial value for a dropdown list something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_with_buttons.js"&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
            | makeresults
            | eval day=strftime(now(), "%d")
            | fields day  
        &amp;lt;/query&amp;gt;
        &amp;lt;done&amp;gt;
          &amp;lt;set token="day"&amp;gt;$result.day$&amp;lt;/set&amp;gt;
        &amp;lt;/done&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;init&amp;gt;
        &amp;lt;set token="start_day"&amp;gt;$day$&amp;lt;/set&amp;gt;
       &amp;lt;/init&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Data Inizio&amp;lt;/title&amp;gt;
      &amp;lt;input type="dropdown" token="start_day"&amp;gt;
        &amp;lt;label&amp;gt;Giorno $start_day$&amp;lt;/label&amp;gt;
        &amp;lt;fieldForLabel&amp;gt;giorno&amp;lt;/fieldForLabel&amp;gt;
        &amp;lt;fieldForValue&amp;gt;giornoid&amp;lt;/fieldForValue&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|inputlookup day.csv| table dayid day&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;choice value="$start_day$"&amp;gt;$start_day$&amp;lt;/choice&amp;gt;
        &amp;lt;default&amp;gt;$start_day$&amp;lt;/default&amp;gt;
      &amp;lt;/input&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;at runtime what I obtain is shown in the picture :&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8700iC8B7E4D56E81EDB8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Any Suggestion ?&lt;BR /&gt;
Thanks &lt;BR /&gt;
Fabrizio&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 08:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476220#M31299</guid>
      <dc:creator>fabrizioalleva</dc:creator>
      <dc:date>2020-04-15T08:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting token for a dropdwn with a search and init</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476221#M31300</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this, Please correct &lt;CODE&gt;fieldForLabel&lt;/CODE&gt; and &lt;CODE&gt;fieldForValue&lt;/CODE&gt; based on your query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_with_buttons.js"&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;
             | makeresults
             | eval day=strftime(now(), "%d")
             | fields day  
         &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;set token="day"&amp;gt;$result.day$&amp;lt;/set&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;init&amp;gt;
    &amp;lt;set token="start_day"&amp;gt;$day$&amp;lt;/set&amp;gt;
  &amp;lt;/init&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;&amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Data Inizio&amp;lt;/title&amp;gt;
      &amp;lt;input type="dropdown" token="start_day"&amp;gt;
        &amp;lt;label&amp;gt;Giorno $start_day$&amp;lt;/label&amp;gt;
        &amp;lt;fieldForLabel&amp;gt;day&amp;lt;/fieldForLabel&amp;gt;
        &amp;lt;fieldForValue&amp;gt;day&amp;lt;/fieldForValue&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults count=31 | streamstats count as day&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;default&amp;gt;$start_day$&amp;lt;/default&amp;gt;
      &amp;lt;/input&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Apr 2020 08:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476221#M31300</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-04-15T08:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Setting token for a dropdwn with a search and init</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476222#M31301</link>
      <description>&lt;P&gt;It doesn't work in the dropdown the default value is not 15 ( today ) is always $day$. &lt;BR /&gt;
It seems that Splunk doesn't accept  the first query which pass the today value in the token. &lt;BR /&gt;
The porpouse is to load a dropdown with the list of days, and by default to show the today value.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 09:27:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476222#M31301</guid>
      <dc:creator>fabrizioalleva</dc:creator>
      <dc:date>2020-04-15T09:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Setting token for a dropdwn with a search and init</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476223#M31302</link>
      <description>&lt;P&gt;Can you try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_with_buttons.js"&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;
             | makeresults
             | eval day=strftime(now(), "%d")
             | fields day  
         &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;set token="day"&amp;gt;$result.day$&amp;lt;/set&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;&amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Data Inizio&amp;lt;/title&amp;gt;
      &amp;lt;input type="dropdown" token="start_day"&amp;gt;
        &amp;lt;label&amp;gt;Giorno $day$&amp;lt;/label&amp;gt;
        &amp;lt;fieldForLabel&amp;gt;day&amp;lt;/fieldForLabel&amp;gt;
        &amp;lt;fieldForValue&amp;gt;day&amp;lt;/fieldForValue&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults count=31 | streamstats count as day&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;default&amp;gt;$day$&amp;lt;/default&amp;gt;
      &amp;lt;/input&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Apr 2020 09:43:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476223#M31302</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-04-15T09:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting token for a dropdwn with a search and init</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476224#M31303</link>
      <description>&lt;P&gt;Ok this works fine !&lt;BR /&gt;
Thanks a lot!&lt;BR /&gt;
How can I accept this as ansswer ??&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 10:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476224#M31303</guid>
      <dc:creator>fabrizioalleva</dc:creator>
      <dc:date>2020-04-15T10:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting token for a dropdwn with a search and init</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476225#M31304</link>
      <description>&lt;P&gt;please click accept button&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 10:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-token-for-a-dropdwn-with-a-search-and-init/m-p/476225#M31304</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-04-15T10:52:34Z</dc:date>
    </item>
  </channel>
</rss>

