<?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 inputlookup in subsearch to filter by one column and to output back the corresponding values of another column to main search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467132#M191867</link>
    <description>&lt;P&gt;Okay so this question has never been asked or answered before so here goes...Hoping someone can assist.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ironport" 
    [ inputlookup exfil_filenames 
    | fields file_name ]
| table file_name matching_criteria
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query has a lookup which has 2 columns: file_name, matching_criteria. The only difference between them is the items in matching_criteria do not have asterisks. Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;file_name   matching_criteria
*hello*        hello
*world*        world
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently the query returns files that match the lookup field "file_name" but in addition to that I also need the corresponding matching criteria value to be associated and returned in the main search. So this is what I'd like to see as the result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table file_name matching_criteria

file_name     matching_criteria
hello_file.xls     hello
world_bank.virus     world
SSN_dump.zip     SSN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;God speed! Hopefully I explained it clearly. Thanks in advanced.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:23:34 GMT</pubDate>
    <dc:creator>yepyepyayyooo</dc:creator>
    <dc:date>2020-09-30T03:23:34Z</dc:date>
    <item>
      <title>inputlookup in subsearch to filter by one column and to output back the corresponding values of another column to main search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467132#M191867</link>
      <description>&lt;P&gt;Okay so this question has never been asked or answered before so here goes...Hoping someone can assist.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ironport" 
    [ inputlookup exfil_filenames 
    | fields file_name ]
| table file_name matching_criteria
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query has a lookup which has 2 columns: file_name, matching_criteria. The only difference between them is the items in matching_criteria do not have asterisks. Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;file_name   matching_criteria
*hello*        hello
*world*        world
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently the query returns files that match the lookup field "file_name" but in addition to that I also need the corresponding matching criteria value to be associated and returned in the main search. So this is what I'd like to see as the result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table file_name matching_criteria

file_name     matching_criteria
hello_file.xls     hello
world_bank.virus     world
SSN_dump.zip     SSN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;God speed! Hopefully I explained it clearly. Thanks in advanced.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467132#M191867</guid>
      <dc:creator>yepyepyayyooo</dc:creator>
      <dc:date>2020-09-30T03:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup in subsearch to filter by one column and to output back the corresponding values of another column to main search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467133#M191868</link>
      <description>&lt;P&gt;Are you familiar with the &lt;CODE&gt;lookup&lt;/CODE&gt; command, and is there a reason that doesn't work for you? If you check out the docs here &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Lookup"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Lookup&lt;/A&gt;, it does essentially what you want (join/lookup on a value, and optionally &lt;CODE&gt;OUTPUT&lt;/CODE&gt; any fields you want).&lt;/P&gt;

&lt;P&gt;Example that should work for you:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ironport"
| lookup exfil_filenames file_name OUTPUT matching_criteria
|table file_name matching_criteria
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternatively and perhaps more performantly,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ironport" 
         [ inputlookup exfil_filenames 
         | fields file_name ]
| lookup exfil_filenames file_name OUTPUT matching_criteria
| table file_name matching_criteria
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You also don't need the wildcards in the csv, there is an option in the lookup configuration that allows you do wildcard a field when doing lookup matches: Settings -&amp;gt; Lookups -&amp;gt; Lookup definitions -&amp;gt; filter to yours -&amp;gt; click it -&amp;gt; advanced options -&amp;gt; Match type -&amp;gt; WILDCARD(file_name).&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 22:20:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467133#M191868</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-12-17T22:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup in subsearch to filter by one column and to output back the corresponding values of another column to main search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467134#M191869</link>
      <description>&lt;P&gt;aberkow thank you for your response. I have tried both examples you have provided. In both scenarios the file_name column populates results however the matching_criteria column is blank; not displaying the matching value.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467134#M191869</guid>
      <dc:creator>yepyepyayyooo</dc:creator>
      <dc:date>2020-09-30T03:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup in subsearch to filter by one column and to output back the corresponding values of another column to main search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467135#M191870</link>
      <description>&lt;P&gt;I should point out that unlike file_name, matching_criteria is not a field in the index. It's only a column header in the lookup table.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467135#M191870</guid>
      <dc:creator>yepyepyayyooo</dc:creator>
      <dc:date>2020-09-30T03:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup in subsearch to filter by one column and to output back the corresponding values of another column to main search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467136#M191871</link>
      <description>&lt;P&gt;Update:&lt;/P&gt;

&lt;P&gt;The reason it wasn't working was because I had wildcard (asterisks) in the lookup file. When I removed those and used the advanced features method aberkow recommended instead, the matching_criteria column returned results.&lt;/P&gt;

&lt;P&gt;Splunk gremlin&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 14:25:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-subsearch-to-filter-by-one-column-and-to-output/m-p/467136#M191871</guid>
      <dc:creator>yepyepyayyooo</dc:creator>
      <dc:date>2019-12-19T14:25:04Z</dc:date>
    </item>
  </channel>
</rss>

