<?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 Error in multiselect - Could not create search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294523#M164887</link>
    <description>&lt;P&gt;Below is the code for multiselect which gets populated dynamically based on user selection. The Search query seems to be working fine outside using Search &amp;amp; Reporting app. But doesnt work when added as dynamic query to dashboard.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" token="tokenhost" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;$hosttype$&amp;lt;/label&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;index=app   sourcetype=app_gc_log  | eval host = case(host like "%" +substr(lower($hosttype$),1, 3)+ "%", host)| dedup host | table host&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;host&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;host&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;valuePrefix&amp;gt;host=&amp;lt;/valuePrefix&amp;gt;
  &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
&amp;lt;/input&amp;gt;
&amp;lt;input type="time" token="field2" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;
    &amp;lt;earliest&amp;gt;-4h@m&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
  &amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 23 Nov 2017 09:37:52 GMT</pubDate>
    <dc:creator>sangs8788</dc:creator>
    <dc:date>2017-11-23T09:37:52Z</dc:date>
    <item>
      <title>Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294523#M164887</link>
      <description>&lt;P&gt;Below is the code for multiselect which gets populated dynamically based on user selection. The Search query seems to be working fine outside using Search &amp;amp; Reporting app. But doesnt work when added as dynamic query to dashboard.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" token="tokenhost" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;$hosttype$&amp;lt;/label&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;index=app   sourcetype=app_gc_log  | eval host = case(host like "%" +substr(lower($hosttype$),1, 3)+ "%", host)| dedup host | table host&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;host&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;host&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;valuePrefix&amp;gt;host=&amp;lt;/valuePrefix&amp;gt;
  &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
&amp;lt;/input&amp;gt;
&amp;lt;input type="time" token="field2" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;
    &amp;lt;earliest&amp;gt;-4h@m&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
  &amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Nov 2017 09:37:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294523#M164887</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2017-11-23T09:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294524#M164888</link>
      <description>&lt;P&gt;What do you mean by "didn't work?" Do you get an error message? &lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 09:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294524#M164888</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-11-23T09:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294525#M164889</link>
      <description>&lt;P&gt;Error displays right below the multiselect "could not create search"&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 09:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294525#M164889</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2017-11-23T09:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294526#M164890</link>
      <description>&lt;P&gt;Where did you define the $hosttype$ token you are using there?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 10:43:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294526#M164890</guid>
      <dc:creator>lukas_loder</dc:creator>
      <dc:date>2017-11-23T10:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294527#M164891</link>
      <description>&lt;P&gt;It is passed from another dashboard  but I am pretty sure the value is getting passed to $hosttype$. I am able to see the value passed.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 10:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294527#M164891</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2017-11-23T10:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294528#M164892</link>
      <description>&lt;P&gt;so you see the new $hosttype$ value in your label? Or is this one empty?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 11:02:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294528#M164892</guid>
      <dc:creator>lukas_loder</dc:creator>
      <dc:date>2017-11-23T11:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294529#M164893</link>
      <description>&lt;P&gt;i see the value in label&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 11:04:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294529#M164893</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2017-11-23T11:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294530#M164894</link>
      <description>&lt;P&gt;@sangs8788, Can you try the following search, which converts both terms to be matched into lower case?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=app sourcetype=app_gc_log 
| eval host = case(match(lower(host),lower(substr("$hosttype$",1, 3))), host) 
| dedup host 
| table host
| sort host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this does not work, can you run the same search for multiselect inside a table to see whether you are getting results?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;table&amp;gt;
   &amp;lt;search&amp;gt;
     &amp;lt;query&amp;gt;index=app   sourcetype=app_gc_log  | eval host = case(host like "%" +substr(lower($hosttype$),1, 3)+ "%", host)| dedup host | table host&amp;lt;/query&amp;gt;
     &amp;lt;earliest&amp;gt;-30d@d&amp;lt;/earliest&amp;gt;
     &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
   &amp;lt;/search&amp;gt;
&amp;lt;/table&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Nov 2017 11:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294530#M164894</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-23T11:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error in multiselect - Could not create search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294531#M164895</link>
      <description>&lt;P&gt;$hosttype$ needs to get an initial value for the search to be built and run. &lt;BR /&gt;
You can do that in another dynamic input or by giving it a static value in another input.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 14:25:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-multiselect-Could-not-create-search/m-p/294531#M164895</guid>
      <dc:creator>danbar6</dc:creator>
      <dc:date>2017-11-23T14:25:06Z</dc:date>
    </item>
  </channel>
</rss>

