<?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: Can you help me with a MAC Address Search in a Splunk dashboard? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385494#M112574</link>
    <description>&lt;P&gt;Cool.yep agree with your rex. Have a nice day.&lt;/P&gt;

&lt;P&gt;Sid&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jan 2019 15:05:54 GMT</pubDate>
    <dc:creator>sdchakraborty</dc:creator>
    <dc:date>2019-01-04T15:05:54Z</dc:date>
    <item>
      <title>Can you help me with a MAC Address Search in a Splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385491#M112571</link>
      <description>&lt;P&gt;Greetings---&lt;/P&gt;

&lt;P&gt;I am trying to build a dashboard form for MAC address regardless of format.&lt;/P&gt;

&lt;P&gt;The goal is to simply have a form field which a user can enter a MAC address in ANY format and still derive results whether the MAC address is indexed with dashes ("-"), colons (":"), or nothing at all..&lt;/P&gt;

&lt;P&gt;e.g.:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;00:00:00:00:00:00 OR 00-00-00-00-00-00 OR 000000000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;search $octet1$:$octet2$:$octet3$:$octet4$:$octet5$:$octet6$ OR  $octet1$-$octet2$-$octet3$-$octet4$-$octet5$-$octet6$&lt;/P&gt;

&lt;P&gt;This is what I have so far:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/710676/why-is-my-query-with-the-eval-command-not-replacin.html"&gt;https://answers.splunk.com/answers/710676/why-is-my-query-with-the-eval-command-not-replacin.html&lt;/A&gt;&lt;BR /&gt;
AND:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/588964/how-can-we-make-multiple-mac-address-formats-be-re.html"&gt;https://answers.splunk.com/answers/588964/how-can-we-make-multiple-mac-address-formats-be-re.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have created a form with tokens to split-up the octets on the MAC address:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt;
           &amp;lt;done&amp;gt;
             &amp;lt;set token="octet1"&amp;gt;$result.octet1$&amp;lt;/set&amp;gt;
             &amp;lt;set token="octet2"&amp;gt;$result.octet2$&amp;lt;/set&amp;gt;
             &amp;lt;set token="octet3"&amp;gt;$result.octet3$&amp;lt;/set&amp;gt;
             &amp;lt;set token="octet4"&amp;gt;$result.octet4$&amp;lt;/set&amp;gt;
             &amp;lt;set token="octet5"&amp;gt;$result.octet5$&amp;lt;/set&amp;gt;
             &amp;lt;set token="octet6"&amp;gt;$result.octet6$&amp;lt;/set&amp;gt;
           &amp;lt;/done&amp;gt;
           &amp;lt;query&amp;gt;$macaddress$
 | eval MAC=replace("$macaddress$","[^A-Za-z0-9]*","")
           | rex field=MAC "^(?&amp;amp;lt;octet1&amp;amp;gt;..)(?&amp;amp;lt;octet2&amp;amp;gt;..)(?&amp;amp;lt;octet3&amp;amp;gt;..)(?&amp;amp;lt;octet4&amp;amp;gt;..)(?&amp;amp;lt;octet5&amp;amp;gt;..)(?&amp;amp;lt;octet6&amp;amp;gt;..)$"
           | dedup octet1
 | table octet1 octet2 octet3 octet4 octet5 octet6&amp;lt;/query&amp;gt;
           &amp;lt;earliest&amp;gt;$field2.earliest$&amp;lt;/earliest&amp;gt;
           &amp;lt;latest&amp;gt;$field2.latest$&amp;lt;/latest&amp;gt;
         &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;*Thanks to twinspop&lt;/P&gt;

&lt;P&gt;And it looks like it is failing with the EVAL function.&lt;/P&gt;

&lt;P&gt;It only seems to find MAC Addresses with colons, but cannot parse mac addresses with any other octet delimiters.&lt;/P&gt;

&lt;P&gt;My questions to the community are: &lt;BR /&gt;
1) "Why is my eval + replace function failing on anything other than a colon?"&lt;BR /&gt;
And &lt;BR /&gt;
2) "why hasn't this been done?".... &lt;/P&gt;

&lt;P&gt;Maybe I am a newb in asking, but doesn't this seem like a pretty standard thing?&lt;/P&gt;

&lt;P&gt;.... Switches, Routers, DHCP, RADIUS... they all use different formats for MAC Address in logs.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 00:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385491#M112571</guid>
      <dc:creator>richardphung</dc:creator>
      <dc:date>2019-01-04T00:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a MAC Address Search in a Splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385492#M112572</link>
      <description>&lt;P&gt;Hi Richard,&lt;/P&gt;

&lt;P&gt;Can you use the below search and see whether its working for you. Just change the query portion. Assuming your mac address textbox token name is "macaddress"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval mac_address = $macaddress$
| rex max_match=0   field=mac_address "(?&amp;lt;octates&amp;gt;\d\d)[:|-]?"
| eval octet1 = mvindex(octates,0),octet2 = mvindex(octates,1),octet3 = mvindex(octates,2),octet4 = mvindex(octates,3),octet5 = mvindex(octates,4),octet6 = mvindex(octates,5)
| table octet1 octet2 octet3 octet4 octet5 octet6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sid&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 09:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385492#M112572</guid>
      <dc:creator>sdchakraborty</dc:creator>
      <dc:date>2019-01-04T09:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a MAC Address Search in a Splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385493#M112573</link>
      <description>&lt;P&gt;BOOM!&lt;BR /&gt;
Thanks, Sid.&lt;/P&gt;

&lt;P&gt;Also, this works best:&lt;BR /&gt;
    | rex max_match=0   field=mac_address "(?&lt;OCTATES&gt;..)[\D]?"&lt;/OCTATES&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:39:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385493#M112573</guid>
      <dc:creator>richardphung</dc:creator>
      <dc:date>2020-09-29T22:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a MAC Address Search in a Splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385494#M112574</link>
      <description>&lt;P&gt;Cool.yep agree with your rex. Have a nice day.&lt;/P&gt;

&lt;P&gt;Sid&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385494#M112574</guid>
      <dc:creator>sdchakraborty</dc:creator>
      <dc:date>2019-01-04T15:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a MAC Address Search in a Splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385495#M112575</link>
      <description>&lt;P&gt;I wonder if &lt;CODE&gt;(?&amp;lt;octates&amp;gt;[A-Fa-f0-9]{2})&lt;/CODE&gt; might be even 'safer' &lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:10:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385495#M112575</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-01-04T15:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a MAC Address Search in a Splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385496#M112576</link>
      <description>&lt;P&gt;Even better rex as MAC address going to be hex numbers.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-MAC-Address-Search-in-a-Splunk-dashboard/m-p/385496#M112576</guid>
      <dc:creator>sdchakraborty</dc:creator>
      <dc:date>2019-01-04T15:32:14Z</dc:date>
    </item>
  </channel>
</rss>

