<?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: Dealing with empty selections in complex forms in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141230#M8499</link>
    <description>&lt;P&gt;i'd still like an answer to this question ...&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2015 13:50:51 GMT</pubDate>
    <dc:creator>lassel</dc:creator>
    <dc:date>2015-06-16T13:50:51Z</dc:date>
    <item>
      <title>Dealing with empty selections in complex forms</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141228#M8497</link>
      <description>&lt;P&gt;I have the following (simplified) dynamic dashboard.&lt;BR /&gt;
You can see the query beeing performed in html.&lt;/P&gt;

&lt;P&gt;I want the sourcetype selection is optional on this dashboard. But as it is the $sourcetype$ token is not resolved until I make a selection in the sourcetype. Setting a default sourcetype to empty doesn't work, because that will make an invalid search and also because the empty selection stays when I select an index.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;How can I make the search run, even if no selection is made to sourcetype?&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;How can I clear the (invalid) sourcetype selections, when I select an index?&lt;/P&gt;

&lt;FORM&gt;
  &lt;FIELDSET submitbutton="true"&gt;
    &lt;INPUT type="dropdown" token="index" searchwhenchanged="true" /&gt;
      &lt;LABEL&gt;Index&lt;/LABEL&gt;
      &lt;SEARCH&gt;
        &lt;QUERY&gt;index=* | dedup index&lt;/QUERY&gt;
        &lt;EARLIEST&gt;0&lt;/EARLIEST&gt;
      &lt;/SEARCH&gt;
      &lt;FIELDFORLABEL&gt;index&lt;/FIELDFORLABEL&gt;
      &lt;FIELDFORVALUE&gt;index&lt;/FIELDFORVALUE&gt;
      &lt;SELECTFIRSTCHOICE&gt;true&lt;/SELECTFIRSTCHOICE&gt;
      &lt;PREFIX&gt;| search index=&lt;/PREFIX&gt;
      &lt;SELECTFIRSTCHOICE&gt;false&lt;/SELECTFIRSTCHOICE&gt;
      &lt;DEFAULT&gt;*&lt;/DEFAULT&gt;
    
    &lt;INPUT type="multiselect" token="sourcetype" searchwhenchanged="false" /&gt;
      &lt;LABEL&gt;Sourcetype&lt;/LABEL&gt;
      &lt;SEARCH&gt;
        &amp;lt;query&amp;gt;$index$ | dedup sourcetype&amp;lt;/query&amp;gt;
        &lt;EARLIEST&gt;0&lt;/EARLIEST&gt;
      &lt;/SEARCH&gt;
      &lt;FIELDFORLABEL&gt;sourcetype&lt;/FIELDFORLABEL&gt;
      &lt;FIELDFORVALUE&gt;sourcetype&lt;/FIELDFORVALUE&gt;
      &lt;!-- Build multi-selection search: 
           (sourcetype ="value1" OR sourcetype ="value2" OR ...)
      --&gt;
      &lt;PREFIX&gt;(&lt;/PREFIX&gt;
      &lt;VALUEPREFIX&gt;sourcetype="&lt;/VALUEPREFIX&gt;
      &lt;VALUESUFFIX&gt;"&lt;/VALUESUFFIX&gt;
      &lt;DELIMITER&gt; OR &lt;/DELIMITER&gt;
      &lt;SUFFIX&gt;)&lt;/SUFFIX&gt;
    
    
      
        &lt;HR /&gt;
      
    
    &lt;INPUT type="text" token="search" searchwhenchanged="true" /&gt;
      &lt;LABEL&gt;Search&lt;/LABEL&gt;
      &lt;DEFAULT&gt;&lt;/DEFAULT&gt;
    
    &lt;INPUT type="time" token="time" searchwhenchanged="true" /&gt;
      &lt;LABEL&gt;Time&lt;/LABEL&gt;
      &lt;DEFAULT&gt;
        &lt;EARLIEST&gt;@d&lt;/EARLIEST&gt;
        &lt;LATEST&gt;now&lt;/LATEST&gt;
      &lt;/DEFAULT&gt;
    
    
      
        &lt;PRE&gt;
          $index$ $sourcetype$ $search$
        &lt;/PRE&gt;
      
    
  &lt;/FIELDSET&gt;
  &lt;ROW&gt;
    &lt;PANEL&gt;
      &lt;EVENT&gt;
        &lt;SEARCH&gt;
          &amp;lt;query&amp;gt;$index$ $sourcetype$ $search$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time.latest$&amp;lt;/latest&amp;gt;
        &lt;/SEARCH&gt;
      &lt;/EVENT&gt;
    &lt;/PANEL&gt;
  &lt;/ROW&gt;
&lt;/FORM&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 03 Jun 2015 13:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141228#M8497</guid>
      <dc:creator>lassel</dc:creator>
      <dc:date>2015-06-03T13:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with empty selections in complex forms</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141229#M8498</link>
      <description>&lt;P&gt;I would also really really like to know, how I can make the user experience of my dashboard, more like the full search page.  &lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2015 13:15:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141229#M8498</guid>
      <dc:creator>lassel</dc:creator>
      <dc:date>2015-06-03T13:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with empty selections in complex forms</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141230#M8499</link>
      <description>&lt;P&gt;i'd still like an answer to this question ...&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 13:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141230#M8499</guid>
      <dc:creator>lassel</dc:creator>
      <dc:date>2015-06-16T13:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with empty selections in complex forms</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141231#M8500</link>
      <description>&lt;P&gt;You could use a &lt;A href="http://dev.splunk.com/view/SP-CAAAEW4"&gt;token forwarder&lt;/A&gt; like this:&lt;/P&gt;

&lt;P&gt;Don't use the sourcetype token in your search directly. Instead, build a new token with the help of a token forwarder. In the Javascript function that actually sets the new forwarded token's value you can easily provide a default value.&lt;/P&gt;

&lt;P&gt;For possible alternatives also look at token change event handlers and token filters, documented on the same page as forwarders.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 15:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141231#M8500</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2016-01-21T15:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with empty selections in complex forms</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141232#M8501</link>
      <description>&lt;P&gt;Did you notice that I use simple XML?&lt;/P&gt;

&lt;P&gt;But I need to convert my dashboard to html to do it?&lt;BR /&gt;
It seems like a complex task for a simple goal..&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 15:49:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141232#M8501</guid>
      <dc:creator>lassel</dc:creator>
      <dc:date>2016-01-21T15:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with empty selections in complex forms</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141233#M8502</link>
      <description>&lt;P&gt;You don't have to convert your dashboard to HTML, you only need to include a script like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="myscript.js"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In that script you can then use the technique I described.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 15:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141233#M8502</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2016-01-21T15:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with empty selections in complex forms</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141234#M8503</link>
      <description>&lt;P&gt;Oh! Great. I had no idea you could do that!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 15:55:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dealing-with-empty-selections-in-complex-forms/m-p/141234#M8503</guid>
      <dc:creator>lassel</dc:creator>
      <dc:date>2016-01-21T15:55:29Z</dc:date>
    </item>
  </channel>
</rss>

