<?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: Find values in lookup that are not in index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485667#M135890</link>
    <description>&lt;P&gt;It sounds like you only have one column in your lookup file. Add a second column to it, call it something like "lookup_match" and set the value to "1" for every row. Then, adjust your query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=gcp_firewall
 | rename data.jsonPayload.rule_details.reference as FW
 | search FW = "network:prod*"
 | rex field=FW "network:prod-a/firewall:(?.*)"
 | rex field=FW "network:prod-b/firewall:(?.*)"
 | rex field=FW "network:prod-c/firewall:(?.*)"
 | rex field=FW "network:prod-d/firewall:(?.*)"
 | rex field=FW "network:prod-e/firewall:(?.*)"
 | lookup firewall-exception-prod.csv firewall_rule as fw OUTPUT lookup_match
 | search NOT lookup_match=*
 | dedup fw
 | table fw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 May 2020 22:29:48 GMT</pubDate>
    <dc:creator>masonmorales</dc:creator>
    <dc:date>2020-05-01T22:29:48Z</dc:date>
    <item>
      <title>Find values in lookup that are not in index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485666#M135889</link>
      <description>&lt;P&gt;I've searched and tried what i can find online and nothing is returning so i thought I'd try here: i need to return the 45 or so values that are in my csv lookup, but NOT in my firewall index. One of the issues I ran into was I had to transform the index values to be able to match the string from the csv (hence all the rex) Thoughts are welcome - thank you!!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=gcp_firewall
| rename data.jsonPayload.rule_details.reference as FW
| search FW = "network:prod*"
| rex field=FW "network:prod-a/firewall:(?.*)"
| rex field=FW "network:prod-b/firewall:(?.*)"
| rex field=FW "network:prod-c/firewall:(?.*)"
| rex field=FW "network:prod-d/firewall:(?.*)"
| rex field=FW "network:prod-e/firewall:(?.*)"
| lookup firewall-exception-prod.csv firewall_rule as fw OUTPUT firewall_rule as fw
| dedup fw
| table fw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 May 2020 15:02:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485666#M135889</guid>
      <dc:creator>katmagee</dc:creator>
      <dc:date>2020-05-01T15:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find values in lookup that are not in index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485667#M135890</link>
      <description>&lt;P&gt;It sounds like you only have one column in your lookup file. Add a second column to it, call it something like "lookup_match" and set the value to "1" for every row. Then, adjust your query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=gcp_firewall
 | rename data.jsonPayload.rule_details.reference as FW
 | search FW = "network:prod*"
 | rex field=FW "network:prod-a/firewall:(?.*)"
 | rex field=FW "network:prod-b/firewall:(?.*)"
 | rex field=FW "network:prod-c/firewall:(?.*)"
 | rex field=FW "network:prod-d/firewall:(?.*)"
 | rex field=FW "network:prod-e/firewall:(?.*)"
 | lookup firewall-exception-prod.csv firewall_rule as fw OUTPUT lookup_match
 | search NOT lookup_match=*
 | dedup fw
 | table fw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 May 2020 22:29:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485667#M135890</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2020-05-01T22:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find values in lookup that are not in index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485668#M135891</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=gcp_firewall data.jsonPayload.rule_details.reference="network:prod*"
 | rename data.jsonPayload.rule_details.reference as FW
 | rex field=FW "network:prod-\w+/firewall:(?&amp;lt;&amp;lt;fw&amp;gt;&amp;gt;.*)"
 | lookup firewall-exception-prod.csv firewall_rule as fw OUTPUT firewall_rule as fw
 | dedup fw
 | table fw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using &lt;CODE&gt;rex&lt;/CODE&gt; ,between &lt;CODE&gt;"&lt;/CODE&gt; can be able to use REGEX.&lt;BR /&gt;
your many &lt;CODE&gt;rex&lt;/CODE&gt; can be one liner, I guess.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 22:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485668#M135891</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-01T22:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Find values in lookup that are not in index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485669#M135892</link>
      <description>&lt;P&gt;It seems like this gives me all the firewalls from the index that aren't in the csv - how do i switch that? I need the firewalls from the csv (that arent in the index)... i should get around 50 and that query gave me 1000+&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 16:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/485669#M135892</guid>
      <dc:creator>katmagee</dc:creator>
      <dc:date>2020-05-11T16:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find values in lookup that are not in index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/598306#M208339</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/58670"&gt;@katmagee&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a similar scenario. I tried the below approach: -&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|inputlookup dummyTable.csv where index="abc" 
|fields index, host
|search NOT
[search index="abc" |dedup host |table index, host]&lt;/LI-CODE&gt;&lt;P&gt;Please replace: -&lt;BR /&gt;dummyTable.csv with your lookup table name&lt;BR /&gt;In my case, index and host are the two common fields between lookup table and index.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please do share if the above approach helps to answer your problem statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 12:46:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-values-in-lookup-that-are-not-in-index/m-p/598306#M208339</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-05-18T12:46:16Z</dc:date>
    </item>
  </channel>
</rss>

