<?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: Dynamic input in Dashboard Panel in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418970#M41003</link>
    <description>&lt;P&gt;@praspai, just to clarify why you need different text boxes? Instead of that you could provide same text box and control the searches with tokens which has dynamic values based on the user input. If you want different labels (for better user experience) for the text box based on the sourcetype, we could do it using token as well. Lets  know if it works &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false" autoRun="false"&amp;gt;
    &amp;lt;input type="dropdown" token="Sourcetype"&amp;gt;
      &amp;lt;label&amp;gt;Sourcetype&amp;lt;/label&amp;gt;
      &amp;lt;choice value="splunkd"&amp;gt;splunkd&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="kvstore"&amp;gt;kvstore&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;splunkd&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="txtToken" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Enter value based on "$Sourcetype$"&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=$Sourcetype$ "$txtToken$" |stats count&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;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&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, 22 Aug 2018 12:53:44 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-08-22T12:53:44Z</dc:date>
    <item>
      <title>Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418969#M41002</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We want to create a dashboard with Dynamic inputs. Like we will provide a dropbox with SourceType. Depending upon the value of Source type different input text boxes should be provided so that user can enter fields and search results will be provided.&lt;/P&gt;

&lt;P&gt;Different input fields dynamically appear on Dashboard depending on the source type.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Prashant &lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 12:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418969#M41002</guid>
      <dc:creator>praspai</dc:creator>
      <dc:date>2018-08-22T12:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418970#M41003</link>
      <description>&lt;P&gt;@praspai, just to clarify why you need different text boxes? Instead of that you could provide same text box and control the searches with tokens which has dynamic values based on the user input. If you want different labels (for better user experience) for the text box based on the sourcetype, we could do it using token as well. Lets  know if it works &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false" autoRun="false"&amp;gt;
    &amp;lt;input type="dropdown" token="Sourcetype"&amp;gt;
      &amp;lt;label&amp;gt;Sourcetype&amp;lt;/label&amp;gt;
      &amp;lt;choice value="splunkd"&amp;gt;splunkd&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="kvstore"&amp;gt;kvstore&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;splunkd&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="txtToken" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Enter value based on "$Sourcetype$"&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=$Sourcetype$ "$txtToken$" |stats count&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;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&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, 22 Aug 2018 12:53:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418970#M41003</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-22T12:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418971#M41004</link>
      <description>&lt;P&gt;Hi @renjith.nair ,&lt;/P&gt;

&lt;P&gt;Thanks for your response.&lt;/P&gt;

&lt;P&gt;We have different attributes for each source type and provide search on those attributes rather free search on raw data. &lt;/P&gt;

&lt;P&gt;Say we have a SourceType as Order. We have different attributes on Order like OrderNumber, Customer ID, Item Number, Item Type. We want to provide search on these attributes. so want to provide different input boxes for these attributes. &lt;/P&gt;

&lt;P&gt;Another source type is Invoice which have different attributes than Order. so inputs on form should dynamically changed as per source type.&lt;/P&gt;

&lt;P&gt;Hope I am able to explain it.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 08:38:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418971#M41004</guid>
      <dc:creator>praspai</dc:creator>
      <dc:date>2018-08-23T08:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418972#M41005</link>
      <description>&lt;P&gt;@praspai,&lt;BR /&gt;
If you have defined set of sourcetypes, you could use event handler to set token. Try the below dashboard example and see if it works for you.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false" autoRun="false"&amp;gt;
    &amp;lt;input type="dropdown" token="Sourcetype"&amp;gt;
      &amp;lt;label&amp;gt;Sourcetype&amp;lt;/label&amp;gt;
      &amp;lt;choice value="order"&amp;gt;order&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="invoice"&amp;gt;invoice&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;order&amp;lt;/default&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition value="order"&amp;gt;
          &amp;lt;set token="show_order"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="show_invoice"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="invoice"&amp;gt;
          &amp;lt;set token="show_invoice"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;unset token="show_order"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
      &amp;lt;/change&amp;gt;
      &amp;lt;initialValue&amp;gt;order&amp;lt;/initialValue&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field1" depends="$show_order$"&amp;gt;
      &amp;lt;label&amp;gt;OrderNumber&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field2" depends="$show_order$"&amp;gt;
      &amp;lt;label&amp;gt;Customer ID&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field3" depends="$show_order$"&amp;gt;
      &amp;lt;label&amp;gt;Item Number&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field4" depends="$show_order$"&amp;gt;
      &amp;lt;label&amp;gt;Item Type&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field5" depends="$show_invoice$"&amp;gt;
      &amp;lt;label&amp;gt;Invoice&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field6" depends="$show_invoice$"&amp;gt;
      &amp;lt;label&amp;gt;Customer Id&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field7" depends="$show_invoice$"&amp;gt;
      &amp;lt;label&amp;gt;Invoice Number&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field8" depends="$show_invoice$"&amp;gt;
      &amp;lt;label&amp;gt;Invoice Type&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Aug 2018 12:39:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418972#M41005</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-23T12:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418973#M41006</link>
      <description>&lt;P&gt;Thanks @renjith.nair ...&lt;/P&gt;

&lt;P&gt;I have created a lookup table which maintains the SourceType and attributes .&lt;/P&gt;

&lt;P&gt;Can I create these text fields dynamically for each attribute for source type ?&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
Prashant &lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 10:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418973#M41006</guid>
      <dc:creator>praspai</dc:creator>
      <dc:date>2018-08-24T10:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418974#M41007</link>
      <description>&lt;P&gt;Hi Prashant,&lt;/P&gt;

&lt;P&gt;As far as  I know, you have to manually create the attributes if its static and then use the tokens to disable/enable them based on the selection.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 11:54:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418974#M41007</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-24T11:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418975#M41008</link>
      <description>&lt;P&gt;Try replacing you first  section with the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="Sourcetype"&amp;gt;
  &amp;lt;label&amp;gt;Sourcetype&amp;lt;/label&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| metadata type=sourcetypes index=* OR index=_*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;| fields sourcetype&lt;BR /&gt;
      &lt;BR /&gt;
    &lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 20:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418975#M41008</guid>
      <dc:creator>JackNobrega</dc:creator>
      <dc:date>2018-08-27T20:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418976#M41009</link>
      <description>&lt;P&gt;Sorry , Not sure why my answer got cut off.&lt;/P&gt;

&lt;P&gt;Try replacing the first input section with the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="Sourcetype"&amp;gt;
  &amp;lt;label&amp;gt;Sourcetype&amp;lt;/label&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| metadata type=sourcetypes index=* OR index=_*| fields sourcetype&amp;lt;/query&amp;gt;
  &amp;lt;/search&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Aug 2018 20:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418976#M41009</guid>
      <dc:creator>JackNobrega</dc:creator>
      <dc:date>2018-08-27T20:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418977#M41010</link>
      <description>&lt;P&gt;Hi @renjith.nair,&lt;/P&gt;

&lt;P&gt;Do you think we can script it in Javascript ?&lt;/P&gt;

&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 09:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/418977#M41010</guid>
      <dc:creator>praspai</dc:creator>
      <dc:date>2018-08-29T09:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic input in Dashboard Panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/568433#M46678</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/117342"&gt;@praspai&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Have u got any soln for this kind of problem?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 18:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-input-in-Dashboard-Panel/m-p/568433#M46678</guid>
      <dc:creator>Harsha111</dc:creator>
      <dc:date>2021-09-24T18:55:54Z</dc:date>
    </item>
  </channel>
</rss>

