<?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 How to search multiple value on the same field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10272#M432</link>
    <description>&lt;P&gt;I have a regex that searches for different types of value on a field:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;| regex _raw="FIELD=(value1|value2|value3)"&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;However this search is painfully slow.  How can you perform this search on the indexed data without creating a very long search string like the below:&lt;/P&gt;

&lt;P&gt;SEARCH FIELD="value1" OR FIELD="value2" OR FIELD="value3"&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2010 03:37:44 GMT</pubDate>
    <dc:creator>BunnyHop</dc:creator>
    <dc:date>2010-03-19T03:37:44Z</dc:date>
    <item>
      <title>How to search multiple value on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10272#M432</link>
      <description>&lt;P&gt;I have a regex that searches for different types of value on a field:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;| regex _raw="FIELD=(value1|value2|value3)"&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;However this search is painfully slow.  How can you perform this search on the indexed data without creating a very long search string like the below:&lt;/P&gt;

&lt;P&gt;SEARCH FIELD="value1" OR FIELD="value2" OR FIELD="value3"&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2010 03:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10272#M432</guid>
      <dc:creator>BunnyHop</dc:creator>
      <dc:date>2010-03-19T03:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple value on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10273#M433</link>
      <description>&lt;P&gt;You create the long search string. You can create the long search string indirectly via a subsearch though, which can load a file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ inputlookup mylist.csv | fields MYFIELDNAME | format ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The file mylist.csv must be in the app lookups folder (probably etc/apps/search/lookups) and must be a CSV file with at least 1 column named MYFIELDNAME, one value per line. You can also generate the lookups from search results using outputlookup if that is the source of your values.&lt;/P&gt;

&lt;P&gt;Update:&lt;/P&gt;

&lt;P&gt;With just a little more work, you can also configure a lookup that maps MYFIELDNAME values to a "groupname", and if you then configure automatic lookups against MYFIELDNAME, then you can just add &lt;CODE&gt;groupname="group"&lt;/CODE&gt; to the query and Splunk will automatically perform the equivalent of expanding the search string for every &lt;CODE&gt;MYFIELDNAME&lt;/CODE&gt; value in the lookup table where &lt;CODE&gt;groupname&lt;/CODE&gt; is mapped to &lt;CODE&gt;group&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2010 07:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10273#M433</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-03-19T07:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple value on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10274#M434</link>
      <description>&lt;P&gt;Yeah it's painfully slow because the data is filtered AFTER the search has run.  I'd just write a little script that expands it out for you on your local machine.  Splunk 4.0.10 recently removed the cap or OR clauses which might be good for you.&lt;/P&gt;

&lt;P&gt;ruby:&lt;/P&gt;

&lt;P&gt;ARGV[0].sub('|', ' or host=')&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2010 07:12:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10274#M434</guid>
      <dc:creator>oreoshake</dc:creator>
      <dc:date>2010-03-19T07:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple value on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10275#M435</link>
      <description>&lt;P&gt;This seems to look at values from an external source, correct?  Is this more efficient?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2010 19:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10275#M435</guid>
      <dc:creator>BunnyHop</dc:creator>
      <dc:date>2010-03-19T19:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple value on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10276#M436</link>
      <description>&lt;P&gt;The external source is a file on the local machine. It will be fast.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2010 20:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10276#M436</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-03-19T20:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple value on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10277#M437</link>
      <description>&lt;P&gt;Sorry but "local" I mean the Splunk search server, not your client workstation.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2010 20:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10277#M437</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-03-19T20:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to search multiple value on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10278#M438</link>
      <description>&lt;P&gt;How do I construct a query with this.?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 13:24:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-value-on-the-same-field/m-p/10278#M438</guid>
      <dc:creator>arungeorge09</dc:creator>
      <dc:date>2015-02-02T13:24:57Z</dc:date>
    </item>
  </channel>
</rss>

