<?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: LAN port Flapping in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64652#M15970</link>
    <description>&lt;P&gt;I also modified the search (added sort - count) at the end to display the results:&lt;BR /&gt;
sourcetype=syslog ETH_PORT_CHANNEL | rex "port-channel(?&lt;PORT&gt;\d+):" | stats count by port | sort - count | where count&amp;gt;=100&lt;/PORT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:20:32 GMT</pubDate>
    <dc:creator>MasterOogway</dc:creator>
    <dc:date>2020-09-28T09:20:32Z</dc:date>
    <item>
      <title>LAN port Flapping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64648#M15966</link>
      <description>&lt;P&gt;I have a LAN port flapping and causing all kinds of noise that I am trying to notify on.&lt;/P&gt;

&lt;P&gt;The syslog looks like this:   &lt;STRONG&gt;%ETH_PORT_CHANNEL-5-FOP_CHANGED: port-channel6:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;What I thought to be a good REX: \s%\w+_\w+-\d+-\w+_\w+:\s\w+-\w+\d+:
doesn't provide any "hits" despite matching in both my REGEX helpers. I have even tried to use this REGEX within the Extract Fields tool without success.&lt;/P&gt;

&lt;P&gt;What I am trying to accomplish is to build a REGEX  to find  this entire string up to the last number. The last port number needs to be counted and sorted by this number and if the port number hits &amp;gt;=100 in 1 minutes alert me.
Here is what I need to search for: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; %ETH_PORT_CHANNEL-5-FOP_CHANGED: port-channel&amp;lt;somenumber&amp;gt;:
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Has anyone been able to, or have advise, to count the port number and alert "where count &amp;gt;=100"?&lt;/P&gt;

&lt;P&gt;pstein&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2010 02:40:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64648#M15966</guid>
      <dc:creator>MasterOogway</dc:creator>
      <dc:date>2010-10-06T02:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: LAN port Flapping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64649#M15967</link>
      <description>&lt;P&gt;You don't have any capture groups in your regular expression, therefore it may match, but it will not return any fields.   You need to use the regex capture group like:  &lt;CODE&gt;(?&amp;lt;field_name&amp;gt;regex)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;A search like this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=syslog ETH_PORT_CHANNEL | rex "port-channel(?&amp;lt;port&amp;gt;\d+):"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To alert based on a repeated occurance of port, you could do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=syslog ETH_PORT_CHANNEL | rex "port-channel(?&amp;lt;port&amp;gt;\d+):" | stats count by port | where count&amp;gt;=100
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Oct 2010 02:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64649#M15967</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-10-06T02:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: LAN port Flapping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64650#M15968</link>
      <description>&lt;P&gt;The second line for alerting was SPOT ON....Now I understand how to assign Fields via a REX on the fly. In this case assigning 'port' coming after port-channel.  Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2010 03:50:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64650#M15968</guid>
      <dc:creator>MasterOogway</dc:creator>
      <dc:date>2010-10-06T03:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: LAN port Flapping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64651#M15969</link>
      <description>&lt;P&gt;Great, sounds like this is working well for you!   If this answers your question, please indicate so by checking the check mark on the left-hand side.  (This will mark the question as answered, and give both of us some reputation points.)&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 00:13:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64651#M15969</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-10-07T00:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: LAN port Flapping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64652#M15970</link>
      <description>&lt;P&gt;I also modified the search (added sort - count) at the end to display the results:&lt;BR /&gt;
sourcetype=syslog ETH_PORT_CHANNEL | rex "port-channel(?&lt;PORT&gt;\d+):" | stats count by port | sort - count | where count&amp;gt;=100&lt;/PORT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64652#M15970</guid>
      <dc:creator>MasterOogway</dc:creator>
      <dc:date>2020-09-28T09:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: LAN port Flapping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64653#M15971</link>
      <description>&lt;P&gt;I changed the alert to:&lt;BR /&gt;
sourcetype=syslog UPDOWN | rex "(?i) Interface (?P&lt;PORT&gt;[^,]+)" | stats count by port | sort - count | where count&amp;gt;=8"&lt;BR /&gt;
so it would catch on my interface report looking like:&lt;/PORT&gt;&lt;/P&gt;

&lt;P&gt;Dec 19 14:10:16.897: %LINK-3-UPDOWN: Interface FastEthernet0/41, changed state to down&lt;/P&gt;

&lt;P&gt;However now if i have multiple switches on which the same interface is bouncing it would all catch it under 1 hit.&lt;BR /&gt;
Would it be possible to include the ip\hostname somehow in the output.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2012 13:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64653#M15971</guid>
      <dc:creator>WenderPutters</dc:creator>
      <dc:date>2012-12-19T13:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: LAN port Flapping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64654#M15972</link>
      <description>&lt;P&gt;host="10.145.254.*" UPDOWN | rex "(?i) Interface (?P&lt;PORT&gt;[^,]+)" | stats count by port,host &lt;BR /&gt;
above was the fix&lt;/PORT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 08:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/LAN-port-Flapping/m-p/64654#M15972</guid>
      <dc:creator>WenderPutters</dc:creator>
      <dc:date>2013-06-07T08:42:13Z</dc:date>
    </item>
  </channel>
</rss>

