<?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 How can I exclude certain IP addresses from a query based on their presence in a lookup table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639750#M221693</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;I'm looking for the search to&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;exclude the ips&amp;nbsp; present in the&amp;nbsp; lookup table&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ips&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;comments&lt;/P&gt;&lt;P&gt;142.45.2.3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scanner&lt;BR /&gt;123.4.45.22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;network&lt;/P&gt;&lt;P&gt;123.66.33.4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert scanner&lt;/P&gt;&lt;P&gt;123.45.7.9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cisa scanner&lt;BR /&gt;&lt;BR /&gt;I'm trying to exclude the ips with the name scanner in the comments section&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 10:21:59 GMT</pubDate>
    <dc:creator>balu1211</dc:creator>
    <dc:date>2023-04-13T10:21:59Z</dc:date>
    <item>
      <title>How can I exclude certain IP addresses from a query based on their presence in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639750#M221693</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I'm looking for the search to&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;exclude the ips&amp;nbsp; present in the&amp;nbsp; lookup table&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ips&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;comments&lt;/P&gt;&lt;P&gt;142.45.2.3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scanner&lt;BR /&gt;123.4.45.22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;network&lt;/P&gt;&lt;P&gt;123.66.33.4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert scanner&lt;/P&gt;&lt;P&gt;123.45.7.9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cisa scanner&lt;BR /&gt;&lt;BR /&gt;I'm trying to exclude the ips with the name scanner in the comments section&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 10:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639750#M221693</guid>
      <dc:creator>balu1211</dc:creator>
      <dc:date>2023-04-13T10:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I exclude certain IP addresses from a query based on their presence in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639751#M221694</link>
      <description>&lt;P&gt;If the IP field in your data is ip.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If you need to exclude any type of scanner, try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search index=abc ip=* 
| lookup iplookupfile.csv ips as ip OUTPUT comments 
|where !match(comments, "scanner")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If alert scanners/cisa scanner shouldnt be excluded, try:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search index=abc ip=* 
| lookup iplookupfile.csv ips as ip OUTPUT comments 
|where !match(comments, "^scanner")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 10:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639751#M221694</guid>
      <dc:creator>andrew_nelson</dc:creator>
      <dc:date>2023-04-13T10:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I exclude certain IP addresses from a query based on their presence in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639760#M221696</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229311"&gt;@andrew_nelson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;How would I be able to exclude src_ip and dest_ip combination?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Can we use *scanner* like this ?&lt;/P&gt;&lt;P&gt;|where !match(comments, "*scanner*")&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 11:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639760#M221696</guid>
      <dc:creator>balu1211</dc:creator>
      <dc:date>2023-04-13T11:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I exclude certain IP addresses from a query based on their presence in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639761#M221697</link>
      <description>&lt;P&gt;The match( ) function is regex pattern matching, it'll match any strings that contain the value specified so you don't need to wildcard with it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;That can be a pain when you want an exact match which is why I provided the second option that uses "^scanner". This checks that the values starts with "scanner", although a better version would be "^scanner$", this would be an exact match.&amp;nbsp;&lt;BR /&gt;^ : Start of string&lt;BR /&gt;$ : End of string&lt;BR /&gt;&lt;BR /&gt;You can see the documentation here:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/ConditionalFunctions#match.28.26lt.3Bstr.26gt.3B.2C_.26lt.3Bregex.26gt.3B.29" target="_blank" rel="noopener"&gt;Comparison and Conditional functions - Splunk Documentation&lt;/A&gt;&lt;BR /&gt;And for regex help, try somewhere like&amp;nbsp;&lt;A href="https://regex101.com/" target="_blank" rel="noopener"&gt;regex101: build, test, and debug regex&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you say a combo, do you mean if the src_ip OR the dest_ip is a scanner ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;your search&amp;gt;
| lookup iplookupfile.csv ips as src_ip OUTPUT comments as src_ip_comments &lt;BR /&gt;| lookup iplookupfile.csv ips as dest_ip OUTPUT comments as dest_ip_comments 
| where !match(src_ip_comments , "scanner") AND !match(dest_ip_comments , "scanner")&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Apr 2023 13:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639761#M221697</guid>
      <dc:creator>andrew_nelson</dc:creator>
      <dc:date>2023-04-13T13:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I exclude certain IP addresses from a query based on their presence in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639763#M221699</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229311"&gt;@andrew_nelson&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;yup&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;src_ip and the dest_ip is a scanner&amp;nbsp;!&lt;BR /&gt;&lt;BR /&gt;IPs from that lookup table should not match src ip as well as dest ip............&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in 'lookup' command: Cannot find the destination field 'src_ip_comments' in the lookup table 'addresses.csv'. is the an error&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 12:43:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639763#M221699</guid>
      <dc:creator>balu1211</dc:creator>
      <dc:date>2023-04-13T12:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I exclude certain IP addresses from a query based on their presence in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639769#M221700</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229311"&gt;@andrew_nelson&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How to exclude&amp;nbsp; ip address to cidr in lookup table?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 12:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639769#M221700</guid>
      <dc:creator>balu1211</dc:creator>
      <dc:date>2023-04-13T12:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I exclude certain IP addresses from a query based on their presence in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639773#M221701</link>
      <description>&lt;P&gt;Made tweaks to the search above to fix the lookup error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For CIDR lookup, you'll need to create a lookup definition and configure advanced settings for match type CIDR(ips)&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 13:11:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639773#M221701</guid>
      <dc:creator>andrew_nelson</dc:creator>
      <dc:date>2023-04-13T13:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I exclude certain IP addresses from a query based on their presence in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639983#M221767</link>
      <description>&lt;P&gt;| tstats ,values(All_Traffic.dest_port) AS dest_port values(All_Traffic.dest_ip) AS dest_ip dc(All_Traffic.dest_ip) AS num_dest_ip dc(All_Traffic.dest_port) AS num_dest_port&lt;BR /&gt;FROM datamodel=Network_Traffic&lt;BR /&gt;WHERE index="firewall" AND sourcetype="traffic"&lt;BR /&gt;BY All_Traffic.src_ip&lt;BR /&gt;| rename All_Traffic.* AS *&lt;BR /&gt;| where (num_dest_ip &amp;gt; 350 AND num_dest_port &amp;gt; 800)&lt;BR /&gt;| lookup address.csv Ips AS src_ip OUTPUT comments AS src_comments&lt;BR /&gt;| where NOT match(src_comments, "(?i)scanner)")&lt;BR /&gt;| lookup address.csv Ips AS dest_ip OUTPUT comments AS dest_comments&lt;BR /&gt;| where NOT match(dest_comments, "(?i)scanner)")&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 18:35:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-exclude-certain-IP-addresses-from-a-query-based-on/m-p/639983#M221767</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2023-04-14T18:35:41Z</dc:date>
    </item>
  </channel>
</rss>

