<?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 to pass multiple parameters from a form input to a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189654#M54625</link>
    <description>&lt;P&gt;Would you be able to force/convince your users to delimit the id's they enter?  If you can, then maybe you can pipe to where instead.  &lt;/P&gt;

&lt;P&gt;For example, if the id's were semicolon delimited, your search might be able to look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=beacon | eval id_list= ltrim($ids$,";") | eval id_list= rtrim(id_list,";") | eval id_list= ";".id_list.";" | where match (id_list,";".id.";") |chart count by country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first few evals are just trying to ensure that we have opening and closing semicolons, and then we only pipe to where the id (surrounded by semicolons) is found in that string&lt;/P&gt;</description>
    <pubDate>Fri, 20 Mar 2015 00:08:59 GMT</pubDate>
    <dc:creator>maciep</dc:creator>
    <dc:date>2015-03-20T00:08:59Z</dc:date>
    <item>
      <title>How to pass multiple parameters from a form input to a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189650#M54621</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have a form that allows users to enter an ID, which will then be populated in a search.&lt;/P&gt;

&lt;P&gt;Is there a way to let users put in X number of ID's and have them all searched?&lt;/P&gt;

&lt;P&gt;I've not been able to work out a way to do this as my query is something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=beacon id=$id$ | chart count by country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To allow them to put in multiple IDs, all I can think of would be to have: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=beacon id=$id$  OR id=$id2$ OR id=$id3$| chart count by country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but then you'd need to know ahead of time how many IDs were going to be passed in.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 12:53:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189650#M54621</guid>
      <dc:creator>ewanbrown</dc:creator>
      <dc:date>2015-03-19T12:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple parameters from a form input to a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189651#M54622</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Try using this sample code below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Test Form&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;&amp;lt;/description&amp;gt;
  &amp;lt;fieldset autoRun="true" submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="limit" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Folder Name&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="limit2" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Workflow Name&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="limit3" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Session Name&amp;lt;/label&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"|eval text1="$limit$"|eval text2="$limit2$"|eval text3="$limit3$" |table text1 text2 text3&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
        &amp;lt;/search&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>Thu, 19 Mar 2015 13:17:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189651#M54622</guid>
      <dc:creator>harshal_chakran</dc:creator>
      <dc:date>2015-03-19T13:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple parameters from a form input to a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189652#M54623</link>
      <description>&lt;P&gt;Thanks, my problem though is I don't know if they will put in 1 ID, 3, 20 (or any number) &lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 14:21:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189652#M54623</guid>
      <dc:creator>ewanbrown</dc:creator>
      <dc:date>2015-03-19T14:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple parameters from a form input to a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189653#M54624</link>
      <description>&lt;P&gt;Yes, this is possible. The best way to do it would be to replace your existing input (I'm assuming it's probably a text box) to a multi-select input with an "OR" delimiter. Here's an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input searchWhenChanged="true" token="id" type="multiselect"&amp;gt;
  &amp;lt;label&amp;gt;ID&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
  &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
  &amp;lt;populatingSearch fieldForLabel="id" fieldForValue="id"&amp;gt; .... | stats count by id&amp;lt;/populatingSearch&amp;gt;
  &amp;lt;delimiter&amp;gt; OR id=&amp;lt;/delimiter&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also recommend putting parenthesis around the token in your results search, as Splunk is going to append "OR id=x, id=y, etc." for as many IDs as your user chooses from the input. &lt;/P&gt;

&lt;P&gt;i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=beacon (id=$id$) | chart count by country
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Mar 2015 20:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189653#M54624</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-03-19T20:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple parameters from a form input to a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189654#M54625</link>
      <description>&lt;P&gt;Would you be able to force/convince your users to delimit the id's they enter?  If you can, then maybe you can pipe to where instead.  &lt;/P&gt;

&lt;P&gt;For example, if the id's were semicolon delimited, your search might be able to look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=beacon | eval id_list= ltrim($ids$,";") | eval id_list= rtrim(id_list,";") | eval id_list= ";".id_list.";" | where match (id_list,";".id.";") |chart count by country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first few evals are just trying to ensure that we have opening and closing semicolons, and then we only pipe to where the id (surrounded by semicolons) is found in that string&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 00:08:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189654#M54625</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2015-03-20T00:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple parameters from a form input to a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189655#M54626</link>
      <description>&lt;P&gt;I have same problem too.&lt;/P&gt;

&lt;P&gt;mine just a simple question as &lt;/P&gt;

&lt;P&gt;there is an input to search data in 1 single sourcetype by using UID&lt;/P&gt;

&lt;P&gt;as now, the UID column only allow 1 UID to search&lt;/P&gt;

&lt;P&gt;how to make it to able multiple search , as my customer would like to input  "uid1 uid2 uid3 uid4.."&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 09:49:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-multiple-parameters-from-a-form-input-to-a-search/m-p/189655#M54626</guid>
      <dc:creator>god2305</dc:creator>
      <dc:date>2015-10-13T09:49:41Z</dc:date>
    </item>
  </channel>
</rss>

