<?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: How do you create a Splunk Dashboard input which allows users to select fields to filter and conditions to filter? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381741#M24964</link>
    <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;xml sample
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="radio" token="con"&amp;gt;
      &amp;lt;label&amp;gt;con&amp;lt;/label&amp;gt;
      &amp;lt;choice value="="&amp;gt;contains&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="!="&amp;gt;not contains&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="FieldA"&amp;gt;
      &amp;lt;label&amp;gt;FieldA&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;

search sample
 (your  search) FieldA$con$$FieldA$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Nov 2018 08:56:16 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2018-11-12T08:56:16Z</dc:date>
    <item>
      <title>How do you create a Splunk Dashboard input which allows users to select fields to filter and conditions to filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381740#M24963</link>
      <description>&lt;P&gt;I have a search dashboard to search the KV Store based on a set of fields.&lt;/P&gt;

&lt;P&gt;Lets say:  FieldA FieldB FieldC FieldD FieldE ... FieldP&lt;/P&gt;

&lt;P&gt;The user wants to filter only by FieldA and FieldB with FieldA=&lt;EM&gt;12&lt;/EM&gt; AND FieldB!=OTHER.&lt;/P&gt;

&lt;P&gt;My search query in the panel will be &lt;CODE&gt;| inputlookup mykv where FieldA=*12*&lt;/CODE&gt; AND &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FieldB!=OTHER
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the user wants to filter by &lt;CODE&gt;FieldE=* AND FieldO=*OTHER*&lt;/CODE&gt;, then my query should change to &lt;CODE&gt;| inputlookup mykv where  FieldE=* AND FieldO=*OTHER*&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;What I have done is to have drop downs for each field where the user can select if he wants to search by "contains" or "not contains" like below.&lt;/P&gt;

&lt;P&gt;The text boxes to enter the string they would want to search on.&lt;/P&gt;

&lt;P&gt;The challenge is: how do i consolidate the tokens for all the text boxes that have a value and create by where condition that can be replaced in my table query with a single token that says for e.g., $query$?&lt;/P&gt;

&lt;P&gt;Would be great if somebody can help me with this. Thank you in advance.&lt;/P&gt;

&lt;P&gt;alt text&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/6069iF76234D16F57427B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 05:51:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381740#M24963</guid>
      <dc:creator>rijutha</dc:creator>
      <dc:date>2018-11-12T05:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create a Splunk Dashboard input which allows users to select fields to filter and conditions to filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381741#M24964</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;xml sample
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="radio" token="con"&amp;gt;
      &amp;lt;label&amp;gt;con&amp;lt;/label&amp;gt;
      &amp;lt;choice value="="&amp;gt;contains&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="!="&amp;gt;not contains&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="FieldA"&amp;gt;
      &amp;lt;label&amp;gt;FieldA&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;

search sample
 (your  search) FieldA$con$$FieldA$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Nov 2018 08:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381741#M24964</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-11-12T08:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create a Splunk Dashboard input which allows users to select fields to filter and conditions to filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381742#M24965</link>
      <description>&lt;P&gt;Thanks HiroshiSatoh. How do i do it when I have multiple fields and sometimes the user would filter by fieldA and sometimes by fieldB? and sometimes by both.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 23:32:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381742#M24965</guid>
      <dc:creator>rijutha</dc:creator>
      <dc:date>2018-11-12T23:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create a Splunk Dashboard input which allows users to select fields to filter and conditions to filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381743#M24966</link>
      <description>&lt;P&gt;I think the same is true when using multiple fields, but what's wrong?&lt;/P&gt;

&lt;P&gt;(your  search) FieldA$con_a$$FieldA$ FieldB$con_b$$FieldB$  FieldC$con_c$$FieldC$ &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:02:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-create-a-Splunk-Dashboard-input-which-allows-users-to/m-p/381743#M24966</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2020-09-29T22:02:45Z</dc:date>
    </item>
  </channel>
</rss>

