<?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: inputlookup and substring search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-and-substring-search/m-p/28769#M5731</link>
    <description>&lt;P&gt;If that solves your problem, please accept the answer by clicking on the checkmark on the left.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2012 12:01:24 GMT</pubDate>
    <dc:creator>ziegfried</dc:creator>
    <dc:date>2012-08-08T12:01:24Z</dc:date>
    <item>
      <title>inputlookup and substring search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-and-substring-search/m-p/28767#M5729</link>
      <description>&lt;P&gt;We need to search if a part of URL in the log matches a string from an external file. As I can see, the method from &lt;A href="http://splunk-base.splunk.com/answers/2457/inputlookup-against-a-list-of-bad-domains"&gt;http://splunk-base.splunk.com/answers/2457/inputlookup-against-a-list-of-bad-domains&lt;/A&gt; does not work as it matches against whole field values and we need to check for a substring match.&lt;/P&gt;

&lt;P&gt;Currently as a workaround we use the command-line search and assemble the search in a shell script from the file so it looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search ... "*string1*" OR "*string2*" OR "*string3*" ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But perhaps there is a better/faster way of doing the search especially given that our search list has been growing.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2012 08:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-and-substring-search/m-p/28767#M5729</guid>
      <dc:creator>igorbukanov</dc:creator>
      <dc:date>2012-08-08T08:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup and substring search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-and-substring-search/m-p/28768#M5730</link>
      <description>&lt;P&gt;You can use a subsearch to create the wildcard-query from a lookup file (field1 is the csv column that contains the fragment to look for)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... [ | inputlookup mylookup | eval search="*"+field1+"*" | fields search ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will expand to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... (( *value1* ) OR ( *value2*) ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The values might need to be quoted:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... [ | inputlookup mylookup | eval search="\"*"+replace(field1,"\"","\\\"")+"*\"" | fields search ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will expand to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... ( ( "*value1*" ) OR ( "*value2*" ) OR ( "*some value3*" ) OR ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2012 08:19:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-and-substring-search/m-p/28768#M5730</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2012-08-08T08:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup and substring search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-and-substring-search/m-p/28769#M5731</link>
      <description>&lt;P&gt;If that solves your problem, please accept the answer by clicking on the checkmark on the left.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2012 12:01:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-and-substring-search/m-p/28769#M5731</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2012-08-08T12:01:24Z</dc:date>
    </item>
  </channel>
</rss>

