<?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: Compare indexed file with lookup table where lookup table field is substring of indexed file field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235177#M188535</link>
    <description>&lt;P&gt;For 2nd option, when you say it's not working, do you get an error OR the filtering is not happening as expected?&lt;/P&gt;

&lt;P&gt;You didn't specify your start_time/end_time condition earlier and that makes it complex. For that you would need to create a lookup definition using which you'd be able to do a lookup based on wildcard. (See this &lt;A href="https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html" target="_blank"&gt;https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html&lt;/A&gt;). After that you can do like this to apply filters&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | lookup yourWildcardLookupDefinition OUTPUT start_time end_time | where isnotnull(start_time) AND _time&amp;gt;start_time AND _time&amp;lt;end_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:00:46 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2020-09-29T09:00:46Z</dc:date>
    <item>
      <title>Compare indexed file with lookup table where lookup table field is substring of indexed file field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235172#M188530</link>
      <description>&lt;P&gt;I want to compare an indexed file with lookup table, where lookup table field is substring of indexed file field&lt;/P&gt;

&lt;P&gt;Sample Indexed file:&lt;/P&gt;

&lt;H2&gt;_time                      file_name&lt;/H2&gt;

&lt;P&gt;03/04/16 7:00       ABC.DFG.123&lt;BR /&gt;
03/04/16 7:00       DEF.DF.A123&lt;BR /&gt;
03/04/16 7:00       QWE.DFG.ABC.peter&lt;BR /&gt;
03/04/16 7:00       DBC.D.030416&lt;BR /&gt;
03/04/16 7:00       QASDFG.123&lt;BR /&gt;
03/04/16 7:00       ASDDFG.ABC.ZXC.MKL123&lt;BR /&gt;
03/04/16 7:00       DEF.DF.A123&lt;BR /&gt;
03/04/16 7:00       QWE.DFG.ABC.peter&lt;BR /&gt;
03/04/16 7:00       DBC.D.030416&lt;BR /&gt;
03/04/16 7:00       QASDFG.123&lt;BR /&gt;
03/04/16 7:00       QASDFG.123&lt;BR /&gt;
03/04/16 7:00       ASDDFG.ABC.ZXC.MKL123&lt;BR /&gt;
03/04/16 7:00       DEF.DF.A123&lt;BR /&gt;
03/04/16 7:00       QWE.DFG.ABC.peter&lt;BR /&gt;
03/04/16 7:00       DBC.D.030416&lt;/P&gt;

&lt;P&gt;Sample Lookup table:&lt;/P&gt;

&lt;H2&gt;file_name&lt;/H2&gt;

&lt;P&gt;ABC.DFG&lt;BR /&gt;
DEF.DF.&lt;BR /&gt;
QWE.DFG.ABC.&lt;BR /&gt;
DBC.D&lt;BR /&gt;
QASDFG&lt;BR /&gt;
ASDDFG.ABC.ZXC.MKL&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235172#M188530</guid>
      <dc:creator>rajchi</dc:creator>
      <dc:date>2020-09-29T08:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Compare indexed file with lookup table where lookup table field is substring of indexed file field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235173#M188531</link>
      <description>&lt;P&gt;How do you want to compare? Do you want to filter only the events with file_name pattern not present in lookup?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 18:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235173#M188531</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-07T18:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Compare indexed file with lookup table where lookup table field is substring of indexed file field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235174#M188532</link>
      <description>&lt;P&gt;Thanks for your reply, I want to filter events with file_name pattern present in lookup&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 18:13:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235174#M188532</guid>
      <dc:creator>rajkumar10</dc:creator>
      <dc:date>2016-03-07T18:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Compare indexed file with lookup table where lookup table field is substring of indexed file field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235175#M188533</link>
      <description>&lt;P&gt;That would be easy.&lt;/P&gt;

&lt;P&gt;Option 1: If you've access to update the lookup table file, update the lookup table to have an asterisk at the end of each value of file_name. &lt;BR /&gt;
Sample Lookup table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;file_name
ABC.DFG*
DEF.DF.*
QWE.DFG.ABC.*
DBC.D*
QASDFG*
ASDDFG.ABC.ZXC.MKL*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then run the search like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar [| inputlookup yourlookupname | table file_name] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will filter to show only the events which file_name matching from lookup.&lt;/P&gt;

&lt;P&gt;Option 2: If you can't update the lookup table content, then use this search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=foo sourcetype=bar [| inputlookup yourlookupname | table file_name | eval file_name=file_name."*" ] 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Mar 2016 20:18:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235175#M188533</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-07T20:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Compare indexed file with lookup table where lookup table field is substring of indexed file field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235176#M188534</link>
      <description>&lt;P&gt;Thanks for your reply &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;, really appreciate it. Somehow option 2 is not working, I can try option 1 as well but my lookup table have other columns too like "start_time" and "end_time". If indexed field(i.e. file_name) is matching to lookup table field(i.e. file_name) then I have to check whether _time(indexed file field) falls between "start_time" and "end_time"(lookup table field) or not.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:59:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235176#M188534</guid>
      <dc:creator>rajchi</dc:creator>
      <dc:date>2020-09-29T08:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Compare indexed file with lookup table where lookup table field is substring of indexed file field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235177#M188535</link>
      <description>&lt;P&gt;For 2nd option, when you say it's not working, do you get an error OR the filtering is not happening as expected?&lt;/P&gt;

&lt;P&gt;You didn't specify your start_time/end_time condition earlier and that makes it complex. For that you would need to create a lookup definition using which you'd be able to do a lookup based on wildcard. (See this &lt;A href="https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html" target="_blank"&gt;https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html&lt;/A&gt;). After that you can do like this to apply filters&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | lookup yourWildcardLookupDefinition OUTPUT start_time end_time | where isnotnull(start_time) AND _time&amp;gt;start_time AND _time&amp;lt;end_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:00:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235177#M188535</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T09:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare indexed file with lookup table where lookup table field is substring of indexed file field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235178#M188536</link>
      <description>&lt;P&gt;Thanks a ton, you saved my day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 22:51:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-indexed-file-with-lookup-table-where-lookup-table-field/m-p/235178#M188536</guid>
      <dc:creator>rajchi</dc:creator>
      <dc:date>2016-03-07T22:51:05Z</dc:date>
    </item>
  </channel>
</rss>

