<?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 Regex exclude multiple subnets in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448357#M99390</link>
    <description>&lt;P&gt;I'm trying to filter out a couple subnets using regex.  This works fine: | regex connection.ip != "^172.16.\d{1,3}.\d{1,3}$" but when I'm having troubles excluding another subnet.  &lt;/P&gt;

&lt;P&gt;This does not work for me: | regex connection.ip != "^172.16.\d{1,3}.\d{1,3}$|^10.10.\d{1,3}.\d{1,3}$"&lt;/P&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 15 Aug 2019 18:31:29 GMT</pubDate>
    <dc:creator>eprovin</dc:creator>
    <dc:date>2019-08-15T18:31:29Z</dc:date>
    <item>
      <title>Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448357#M99390</link>
      <description>&lt;P&gt;I'm trying to filter out a couple subnets using regex.  This works fine: | regex connection.ip != "^172.16.\d{1,3}.\d{1,3}$" but when I'm having troubles excluding another subnet.  &lt;/P&gt;

&lt;P&gt;This does not work for me: | regex connection.ip != "^172.16.\d{1,3}.\d{1,3}$|^10.10.\d{1,3}.\d{1,3}$"&lt;/P&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 18:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448357#M99390</guid>
      <dc:creator>eprovin</dc:creator>
      <dc:date>2019-08-15T18:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448358#M99391</link>
      <description>&lt;P&gt;can we see the sample events and what you are trying to extract?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 18:43:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448358#M99391</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-15T18:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448359#M99392</link>
      <description>&lt;P&gt;index="divit" sourcetype="pps_messagelog" final_module=spam final_rule="safe" | dedup msg.header.message-id{} &lt;BR /&gt;
| transaction filter.qid&lt;BR /&gt;
| regex connection.ip != "^172.16.\d{1,3}.\d{1,3}$"&lt;BR /&gt;
| table _time,connection.sid,filter.qid,envelope.from,msg.header.to,subject,connection.ip,connection.host&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:45:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448359#M99392</guid>
      <dc:creator>eprovin</dc:creator>
      <dc:date>2020-09-30T01:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448360#M99393</link>
      <description>&lt;P&gt;i meant your event samples...we need to see the two subnets you refer to and why the second rex is failing&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 18:47:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448360#M99393</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-15T18:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448361#M99394</link>
      <description>&lt;P&gt;We need to see sample data to know what regex string will match it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 18:47:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448361#M99394</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-15T18:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448362#M99395</link>
      <description>&lt;P&gt;Sorry - newbie here.  Is this what you're looking for?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  connection:   {   [-] 
     country:    eu 
     helo:   omp.save.spirit-airlines.com   
     host:   omp.save.spirit-airlines.com   
     ip:     12.130.136.48  
     protocol:   smtp:smtp  
     resolveStatus:  ok 
     sid:    2ubf9su5eg 
     tls:   {   [+] 
    }   
}   
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Aug 2019 19:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448362#M99395</guid>
      <dc:creator>eprovin</dc:creator>
      <dc:date>2019-08-15T19:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448363#M99396</link>
      <description>&lt;P&gt;Based on the example of /16 or /24, you could just use wildcard:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search connection.ip!=172.16.* AND connection.ip!=10.10.*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or you could use cidrmatch if you need more complex matching:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where NOT cidrmatch(172.16.0.0/16,connection.ip)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or you might just try loosening up your regex, by removing the startline (^) and endline ($) markers, in case the value is space padded:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| regex connection.ip != "172.16.\d{1,3}.\d{1,3}|10.10.\d{1,3}.\d{1,3}"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Aug 2019 19:04:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448363#M99396</guid>
      <dc:creator>solarboyz1</dc:creator>
      <dc:date>2019-08-15T19:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448364#M99397</link>
      <description>&lt;P&gt;Thanks for the suggestion, but it still will only remove whichever filter is first.  Any other ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 00:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448364#M99397</guid>
      <dc:creator>eprovin</dc:creator>
      <dc:date>2019-08-16T00:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Regex exclude multiple subnets</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448365#M99398</link>
      <description>&lt;P&gt;Loosening the regex did seem to do the trick - thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 13:57:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-exclude-multiple-subnets/m-p/448365#M99398</guid>
      <dc:creator>eprovin</dc:creator>
      <dc:date>2019-08-16T13:57:03Z</dc:date>
    </item>
  </channel>
</rss>

