<?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: Lookup - Filter a search with lookup content in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Filter-a-search-with-lookup-content/m-p/656841#M226867</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260346"&gt;@NunnuN&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: do you want to take only the E_MAILs in the index that match with the lookup or what else?&lt;/P&gt;&lt;P&gt;if you want the matching E-MAILs, you have to use a subsearch like the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="data" sourcetype="entities" [ | inputlookup 20230904_NeverLoggedIn.csv | rename E_MAIL  AS EXTERNAL_EMAIL | fields EXTERNAL_EMAIL ]
| table EXTERNAL_EMAIL CATEGORY&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2023 14:21:37 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-09-06T14:21:37Z</dc:date>
    <item>
      <title>Lookup - Filter a search with lookup content</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Filter-a-search-with-lookup-content/m-p/656837#M226864</link>
      <description>&lt;P&gt;Greetings.&lt;/P&gt;&lt;P&gt;I am quite new to Splunk and read a lot of sources.&lt;/P&gt;&lt;P&gt;However, I have a hard time to find my answer about the join and eval functions.&lt;/P&gt;&lt;P&gt;I have a first search on an index. I want to filter this search with values of one field in a csv I import as lookup.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;index="data" sourcetype="entities" | table EMAIL EXTERNAL_EMAIL CATEGORY&lt;/P&gt;&lt;P&gt;And I have the inputlookup&lt;/P&gt;&lt;P&gt;&amp;nbsp;inputlookup 20230904_NeverLoggedIn.csv&lt;/P&gt;&lt;P&gt;How do I compare the field EXTERNAL_EMAIL from the index to the E_MAIL field in the csv file as a filter?&lt;/P&gt;&lt;P&gt;Many thanks for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 14:03:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Filter-a-search-with-lookup-content/m-p/656837#M226864</guid>
      <dc:creator>NunnuN</dc:creator>
      <dc:date>2023-09-06T14:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup - Filter a search with lookup content</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Filter-a-search-with-lookup-content/m-p/656841#M226867</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260346"&gt;@NunnuN&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: do you want to take only the E_MAILs in the index that match with the lookup or what else?&lt;/P&gt;&lt;P&gt;if you want the matching E-MAILs, you have to use a subsearch like the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="data" sourcetype="entities" [ | inputlookup 20230904_NeverLoggedIn.csv | rename E_MAIL  AS EXTERNAL_EMAIL | fields EXTERNAL_EMAIL ]
| table EXTERNAL_EMAIL CATEGORY&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 14:21:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Filter-a-search-with-lookup-content/m-p/656841#M226867</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-09-06T14:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup - Filter a search with lookup content</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Filter-a-search-with-lookup-content/m-p/656891#M226883</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;points out you can do this with a subsearch/inputlookup to the outer search or you can do it with a lookup + where clause - try both and use the one that gives you the best performance&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="data" sourcetype="entities" 
``` This will lookup the EXTERNAL_EMAIL field in the data against the E_MAIL
    field in the CSV ```
| lookup 20230904_NeverLoggedIn.csv E_MAIL as EXTERNAL_EMAIL OUTPUT E_MAIL as Found
``` If the EXTERNAL_EMAIL is Found in this case, it will give you the result
    Changed to isnull(Found) to find users that do NOT exist in the CSV ```
| where isnotnull(Found)
| table EMAIL EXTERNAL_EMAIL CATEGORY&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Sep 2023 22:47:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Filter-a-search-with-lookup-content/m-p/656891#M226883</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-09-06T22:47:56Z</dc:date>
    </item>
  </channel>
</rss>

