<?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: Matching both sides of two kv pairs over time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Matching-both-sides-of-two-kv-pairs-over-time/m-p/41803#M9682</link>
    <description>&lt;P&gt;Probably needs tweaking, but these should give you some ideas...
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;B&gt;Simplest approach&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Look over some period for any cases where one IP address has more than one MAC address:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | stats dc(senderMAC) as MACCount list(senderMAC) by senderIP
    | search MACCount &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;B&gt;Track all New MACs for a given IP&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Search 1 -- Tracking:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | dedup senderIP, senderMAC | fields senderIP, senderMAC
    | outputlookup arplookup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Search 2 -- Alerting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | dedup senderIP, senderMAC
   | lookup arplookup senderIP OUTPUT senderMAC as oldMAC
   | search oldMAC=* NOT senderMAC=oldMAC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;
&lt;B&gt;Track all New MAC-IP Pairs&lt;/B&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;This should have the (desirable or undesirable) side effect of also alerting on all new pairs, not just when a MAC address changes...&lt;/P&gt;

&lt;P&gt;Search 1 -- Tracking:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | dedup senderMAC, senderIP | eval knownpair =1
    | fields senderMAC,senderIP,knownpair | outputlookup macpairs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Search 2 -- Alerting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | lookup macpairs senderMAC, senderIP OUTPUT knownpair
    | search NOT knownpair=1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Sep 2010 05:44:55 GMT</pubDate>
    <dc:creator>southeringtonp</dc:creator>
    <dc:date>2010-09-02T05:44:55Z</dc:date>
    <item>
      <title>Matching both sides of two kv pairs over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-both-sides-of-two-kv-pairs-over-time/m-p/41802#M9681</link>
      <description>&lt;P&gt;I have a small DTrace app that monitors ARP requests and replies, producing output like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 2010 Sep  1 03:10:08 [type=Reply][senderMAC=0:3:ba:d1:1e:17][senderIP=1.2.3.4][targetMAC=0:1:d7:3b:55:44][targetIP=1.2.3.5]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm interested in knowing if any (senderMAC, senderIP) pair differs from previously seen instances over some period of time, in roughly the way that arpwatch would alert me of a change.&lt;/P&gt;

&lt;P&gt;Can't quite work out a strategy for this in Splunk. Any help?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2010 02:34:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-both-sides-of-two-kv-pairs-over-time/m-p/41802#M9681</guid>
      <dc:creator>pde</dc:creator>
      <dc:date>2010-09-02T02:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Matching both sides of two kv pairs over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-both-sides-of-two-kv-pairs-over-time/m-p/41803#M9682</link>
      <description>&lt;P&gt;Probably needs tweaking, but these should give you some ideas...
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;B&gt;Simplest approach&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Look over some period for any cases where one IP address has more than one MAC address:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | stats dc(senderMAC) as MACCount list(senderMAC) by senderIP
    | search MACCount &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;B&gt;Track all New MACs for a given IP&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Search 1 -- Tracking:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | dedup senderIP, senderMAC | fields senderIP, senderMAC
    | outputlookup arplookup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Search 2 -- Alerting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | dedup senderIP, senderMAC
   | lookup arplookup senderIP OUTPUT senderMAC as oldMAC
   | search oldMAC=* NOT senderMAC=oldMAC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;
&lt;B&gt;Track all New MAC-IP Pairs&lt;/B&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;This should have the (desirable or undesirable) side effect of also alerting on all new pairs, not just when a MAC address changes...&lt;/P&gt;

&lt;P&gt;Search 1 -- Tracking:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | dedup senderMAC, senderIP | eval knownpair =1
    | fields senderMAC,senderIP,knownpair | outputlookup macpairs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Search 2 -- Alerting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=foo | lookup macpairs senderMAC, senderIP OUTPUT knownpair
    | search NOT knownpair=1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Sep 2010 05:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-both-sides-of-two-kv-pairs-over-time/m-p/41803#M9682</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-09-02T05:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Matching both sides of two kv pairs over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-both-sides-of-two-kv-pairs-over-time/m-p/41804#M9683</link>
      <description>&lt;P&gt;Ah, jeeze, a lookup table. I should have thought of that.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2010 06:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-both-sides-of-two-kv-pairs-over-time/m-p/41804#M9683</guid>
      <dc:creator>pde</dc:creator>
      <dc:date>2010-09-02T06:43:38Z</dc:date>
    </item>
  </channel>
</rss>

