<?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 search a field  with multiple values from an Input BOX? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391176#M25663</link>
    <description>&lt;P&gt;Let me check it with my existing query. However, you already taught me a lot with these functionalities &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 14:31:08 GMT</pubDate>
    <dc:creator>Chandras11</dc:creator>
    <dc:date>2018-11-13T14:31:08Z</dc:date>
    <item>
      <title>How do you search a field  with multiple values from an Input BOX?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391172#M25659</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I currently have a working report as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`Master_Search`  |eval Upper_Element = upper(Element)| rex field=Upper_Element mode=sed "s/ //g"  | search(Upper_Element = "*K21A*" OR Upper_Element = "*DG23*" OR Upper_Element = "*FM23*"  OR Upper_Element = "*DP14*")| 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, I want to convert it to a dashboard with a user input where I can fetch the search values in the Input box in the dashboard: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
       &amp;lt;input type="multiselect" searchWhenChanged="true" token="Element_t"&amp;gt;
        &amp;lt;label&amp;gt;Element in Upper case&amp;lt;/label&amp;gt;
        &amp;lt;default&amp;gt;K21A DG23 FM23&amp;lt;/default&amp;gt;
      &amp;lt;/input&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I am not certain how I can get the similar results as the above query. I tried the following approaches&lt;BR /&gt;
1. I have tried to use the subquery&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search * | head 1 | eval Upper_Element="$Element_t$" | makemv delim=" " Upper_Element | fields Upper_Element]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Tried to use the delimiter in multi-select as &lt;/P&gt;

&lt;P&gt;XdelimiterY &lt;EM&gt;" OR Upper_Element = "&lt;/EM&gt; X/delimiterY //replace the X and Y with less than and greater than symbol&lt;BR /&gt;
But, I am not getting the proper results.  Could you please direct me to the correct path. I am really confused here. &lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Thanks a lot in advance for the help.&lt;/P&gt;

&lt;P&gt;Br,&lt;BR /&gt;
Chandra&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 18:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391172#M25659</guid>
      <dc:creator>Chandras11</dc:creator>
      <dc:date>2018-11-12T18:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search a field  with multiple values from an Input BOX?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391173#M25660</link>
      <description>&lt;P&gt;Searching is generally case insensitive, so do you need to do all that changing to upper and creating a new field?  I was able to do something like this below with the multiselect and just add it to my search with the Prefix/Suffix in the multiselect options.  Also see the examples dashboard, they give a good example on how to use the multiselect.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="multiselect" searchWhenChanged="true" token="Element_t"&amp;gt;
      &amp;lt;label&amp;gt;Element in Upper case&amp;lt;/label&amp;gt;
      &amp;lt;choice value="K21A"&amp;gt;K21A&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="DG23"&amp;gt;DG23&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="FM23"&amp;gt;FM23&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;K21A,DG23,FM23&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;initialValue&amp;gt;K21A,DG23,FM23&amp;lt;/initialValue&amp;gt;
      &amp;lt;valuePrefix&amp;gt;Element="*&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;*"&amp;lt;/valueSuffix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&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;`Master_Search` $Element_t$ |&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Nov 2018 21:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391173#M25660</guid>
      <dc:creator>bkirk</dc:creator>
      <dc:date>2018-11-12T21:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search a field  with multiple values from an Input BOX?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391174#M25661</link>
      <description>&lt;P&gt;Thanks for the prefix and suffix information. In my index, there are more then 100000+ elements with 64 columns dependent on them. The user wants to give the element name as a single string with space in between.  I need to first extract all Elements separately and then make a search with OR. &lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 06:57:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391174#M25661</guid>
      <dc:creator>Chandras11</dc:creator>
      <dc:date>2018-11-13T06:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search a field  with multiple values from an Input BOX?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391175#M25662</link>
      <description>&lt;P&gt;Ok how about this I used makeresults in a subsearch to build the search and added the format to add the OR's:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;fieldset submitButton="true"&amp;gt;
    &amp;lt;input type="multiselect" searchWhenChanged="true" token="Element_t"&amp;gt;
      &amp;lt;label&amp;gt;Element in Upper case&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*K21A* *DG23* *FM23*"&amp;gt;K21A DG23 FM23&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;K21A DG23 FM23&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;"&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;initialValue&amp;gt;*K21A* *DG23* *FM23*&amp;lt;/initialValue&amp;gt;
      &amp;lt;valuePrefix&amp;gt;&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;&amp;lt;/valueSuffix&amp;gt;
      &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this is the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;`Master_Search` [|makeresults |eval Element=$Element_t$ |eval Element=split(Element," ")|table Element | format "(" "" "" "" "OR" ")"]&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Keep in mind that the *'s are going to make the search slow but if these strings are in the middle of Element with no spaces before and after or special characters you will need them.  I would leave the *'s out if you can. Also if these values need to be found in any part of the row not just in the Element you can change the Element to search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;`Master_Search` [|makeresults |eval search=$Element_t$ |eval search=split(search," ")|table search | format "(" "" "" "" "OR" ")"]&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps you.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 14:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391175#M25662</guid>
      <dc:creator>bkirk</dc:creator>
      <dc:date>2018-11-13T14:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search a field  with multiple values from an Input BOX?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391176#M25663</link>
      <description>&lt;P&gt;Let me check it with my existing query. However, you already taught me a lot with these functionalities &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 14:31:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391176#M25663</guid>
      <dc:creator>Chandras11</dc:creator>
      <dc:date>2018-11-13T14:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search a field  with multiple values from an Input BOX?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391177#M25664</link>
      <description>&lt;P&gt;I have remembered a lot of things that I forgot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Here is a good answer on the format function does a good job explaining it:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/351834/how-can-i-use-a-search-results-table-to-power-anot.html"&gt;https://answers.splunk.com/answers/351834/how-can-i-use-a-search-results-table-to-power-anot.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 14:48:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-search-a-field-with-multiple-values-from-an-Input-BOX/m-p/391177#M25664</guid>
      <dc:creator>bkirk</dc:creator>
      <dc:date>2018-11-13T14:48:33Z</dc:date>
    </item>
  </channel>
</rss>

