<?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: Using indexed DHCPD logs to find MAC address for IP in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103405#M26730</link>
    <description>&lt;P&gt;The join/sub-search is my first method.  The volume of DHCP Accept messages is high, so I quickly hit the max number of events.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jan 2013 16:22:42 GMT</pubDate>
    <dc:creator>Adam_Sealey</dc:creator>
    <dc:date>2013-01-29T16:22:42Z</dc:date>
    <item>
      <title>Using indexed DHCPD logs to find MAC address for IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103403#M26728</link>
      <description>&lt;P&gt;I'm trying to leverage my indexed DHCPD logs to provide additional information about internal IP's that show up in other events.  Specifically, I want to lookup the src_mac and src_host field and add them to the event (for example, a firewall event).  This seems pretty easy with an external dynamic lookup, but since I've already indexed the data, I'd like to leverage it.&lt;/P&gt;

&lt;P&gt;What I think I want is something like a correlated subquery in SQL (have the subsearch look for the &lt;CODE&gt;src_ip&lt;/CODE&gt; specific for an event), but it sounds like Splunk search doesn't work that way.&lt;/P&gt;

&lt;P&gt;I've tried a few different methods, but none seem to be quite right.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Join/Subsearch method&lt;/STRONG&gt; (This is slow, and hits the subsearch limits, so doesn't seem to be the right way to do it):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=someSourcetype | join src_ip usetime=true earlier=true [search eventtype="dhcpd_server_dhcpack" src_ip=* src_mac=* | fields _time src_ip src_mac src_host]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Appended search Transaction Method&lt;/STRONG&gt; (Requires the ip looking up to be specified for both searches, which doesn't work for what I'm trying to do): &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=someSourceType src_ip=192.168.1.1 | append [search eventtype="dhcpd_server_dhcpack" src_ip=192.168.1.1 | fields src_ip src_mac src_host] | transaction src_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Combined Transaction Method&lt;/STRONG&gt; (If I don't specify the &lt;CODE&gt;src_mac&lt;/CODE&gt;, it doesn't detect device changes on the IP.  If I do, it doesn't seem to work correctly either):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype=someSourceType) OR (eventtype="dhcpd_server_dhcpack") | transaction src_ip src_mac | table src_ip threat_id _time src_mac src_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:12:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103403#M26728</guid>
      <dc:creator>Adam_Sealey</dc:creator>
      <dc:date>2020-09-28T13:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using indexed DHCPD logs to find MAC address for IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103404#M26729</link>
      <description>&lt;P&gt;You want a join with a sub search, or a lookup (if you maintain a lookup table of ip-&amp;gt;mac address)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 16:20:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103404#M26729</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-01-29T16:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using indexed DHCPD logs to find MAC address for IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103405#M26730</link>
      <description>&lt;P&gt;The join/sub-search is my first method.  The volume of DHCP Accept messages is high, so I quickly hit the max number of events.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 16:22:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103405#M26730</guid>
      <dc:creator>Adam_Sealey</dc:creator>
      <dc:date>2013-01-29T16:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using indexed DHCPD logs to find MAC address for IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103406#M26731</link>
      <description>&lt;P&gt;Do you really have more than 10000 pairs of ip/mac address ?&lt;BR /&gt;
To reduce that, you can use a time bucketing per hour to avoid doing a time resolution for every single timestamp.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=someSourcetype | eval timerange=_time | bucket timerange span=1d | join src_ip timerange [search eventtype="dhcpd_server_dhcpack" src_ip=* src_mac=* | eval timerange=_time | bucket timerange span=1d | stats values(src_mac) AS list_src_mac first(src_mac) AS src_mac values(src_mac_hosts) AS list_src_hosts first(src_host) AS src_hosts) by src_ip timerange ]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:38:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103406#M26731</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-01-29T19:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using indexed DHCPD logs to find MAC address for IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103407#M26732</link>
      <description>&lt;P&gt;That seems to work, and reasonably fast! Thanks for the help.  I'm working through comparing to my other systems to make sure that everything lines up.&lt;/P&gt;

&lt;P&gt;The one tweak is that you have an extra ) after src_hosts.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2013 15:30:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103407#M26732</guid>
      <dc:creator>Adam_Sealey</dc:creator>
      <dc:date>2013-02-21T15:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using indexed DHCPD logs to find MAC address for IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103408#M26733</link>
      <description>&lt;P&gt;It's interesting..this seems to work for very recent events (with the last 8 hours), but when I got outside of that window, there are no results.  I'm guessing it has something to do with the bucketing..Any other ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2013 16:08:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-indexed-DHCPD-logs-to-find-MAC-address-for-IP/m-p/103408#M26733</guid>
      <dc:creator>Adam_Sealey</dc:creator>
      <dc:date>2013-02-21T16:08:23Z</dc:date>
    </item>
  </channel>
</rss>

