<?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: Require input value in text box in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112620#M6447</link>
    <description>&lt;P&gt;put a java script in your input and validate it. If no input is given re-focus on that again. Could you give it a try?&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jun 2014 03:51:15 GMT</pubDate>
    <dc:creator>linu1988</dc:creator>
    <dc:date>2014-06-20T03:51:15Z</dc:date>
    <item>
      <title>Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112618#M6445</link>
      <description>&lt;P&gt;When a user clicks on the search button in the dashboard, it will run the search query, populating the panel with the chart. What can I do to make it so that there has to be a value in the text box for token $hostName1$ ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldset submitButton="true"&amp;gt;
    &amp;lt;input type="text" token="hostName1"&amp;gt;
      &amp;lt;label&amp;gt;Host 1&amp;lt;/label&amp;gt;
      &amp;lt;default/&amp;gt;
      &amp;lt;prefix&amp;gt; host=&amp;lt;/prefix&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="hostName2"&amp;gt;
      &amp;lt;label&amp;gt;Host 2&amp;lt;/label&amp;gt;
      &amp;lt;default/&amp;gt;
      &amp;lt;prefix&amp;gt;OR host=&amp;lt;/prefix&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="hostName3"&amp;gt;
      &amp;lt;default/&amp;gt;
      &amp;lt;label&amp;gt;Host 3&amp;lt;/label&amp;gt;
      &amp;lt;prefix&amp;gt;OR host=&amp;lt;/prefix&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="hostName4"&amp;gt;
      &amp;lt;default/&amp;gt;
      &amp;lt;label&amp;gt;Host 4&amp;lt;/label&amp;gt;
      &amp;lt;prefix&amp;gt;OR host=&amp;lt;/prefix&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="hostName5"&amp;gt;
      &amp;lt;default/&amp;gt;
      &amp;lt;label&amp;gt;Host 5&amp;lt;/label&amp;gt;
      &amp;lt;prefix&amp;gt;OR host=&amp;lt;/prefix&amp;gt;
    &amp;lt;/input&amp;gt;

    &amp;lt;chart&amp;gt;
      &amp;lt;title&amp;gt;Percent CPU Utilized &amp;lt;/title&amp;gt;
      &amp;lt;searchString&amp;gt;index=os_core $hostName1$ $hostName2$ $hostName3$ $hostName4$ $hostName5$ $hostName6$ | eval PctCPU = 100 - pctIdle  | timechart avg(PctCPU) by host&amp;lt;/searchString&amp;gt;
      &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.chart"&amp;gt;line&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.legend.placement"&amp;gt;bottom&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.secondaryAxis.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
      &amp;lt;option name="count"&amp;gt;50&amp;lt;/option&amp;gt;
      &amp;lt;option name="displayRowNumbers"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.drilldown"&amp;gt;&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.secondaryAxis.minimumNumber"&amp;gt;0&amp;lt;/option&amp;gt;
      &amp;lt;option name="charting.secondaryAxis.maximumNumber"&amp;gt;100&amp;lt;/option&amp;gt;
      &amp;lt;option name="height"&amp;gt;150px&amp;lt;/option&amp;gt;
    &amp;lt;/chart&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jun 2014 23:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112618#M6445</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-19T23:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112619#M6446</link>
      <description>&lt;P&gt;Is this possible since without the host field, the time chart will still be able to run once the submit button is hit.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 23:53:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112619#M6446</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-19T23:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112620#M6447</link>
      <description>&lt;P&gt;put a java script in your input and validate it. If no input is given re-focus on that again. Could you give it a try?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2014 03:51:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112620#M6447</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-06-20T03:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112621#M6448</link>
      <description>&lt;P&gt;If there is no way to do this in advance xml, then I will tell our users that they will have to make this a development item.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2014 15:52:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112621#M6448</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-20T15:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112622#M6449</link>
      <description>&lt;P&gt;You could just set the default value to * if matching multiple hosts is okay.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2014 17:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112622#M6449</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2014-06-20T17:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112623#M6450</link>
      <description>&lt;P&gt;you can do it. Using the pulldown module user have to choose one value or a default value will be chosen.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jun 2014 02:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112623#M6450</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-06-21T02:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112624#M6451</link>
      <description>&lt;P&gt;@linu1988 I am looking into the side view util app for more info on the pulldown module. It is too bad that the number of host values is over 100, which is why we need a text input box.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jun 2014 03:40:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112624#M6451</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-22T03:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112625#M6452</link>
      <description>&lt;P&gt;I wonder if you can default the value to something that would not even start the search. I don't think that's possible though.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jun 2014 03:48:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112625#M6452</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-22T03:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Require input value in text box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112626#M6453</link>
      <description>&lt;P&gt;You could split the input field token and dashboard token to be two tokens. Then use SplunkJS to populate the second token only when the first one has a non-empty value. In the meantime the dashboard will refuse to render anything with the second token until it is populated.&lt;/P&gt;

&lt;P&gt;Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require(['splunkjs/ready!'], function(mvc) {
    mvc.Components.get('default').on('change:inputToken', function(model, newValue) {
        if (newValue) {
            mvc.Components.get('submitted').set('dashboardToken', newValue);
        }
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More info here: &lt;A href="http://dev.splunk.com/view/webframework-concepts/SP-CAAAEW4"&gt;http://dev.splunk.com/view/webframework-concepts/SP-CAAAEW4&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2014 16:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Require-input-value-in-text-box/m-p/112626#M6453</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2014-06-23T16:41:04Z</dc:date>
    </item>
  </channel>
</rss>

