<?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 How can we make multiple MAC address formats be readable in one search, regardless of format? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353263#M104550</link>
    <description>&lt;P&gt;I'm still pretty new so the answer is probably easy, but am stuck trying to making this search form work.  The goal is to allow our users to enter a MAC address in any format such as:&lt;BR /&gt;
0030652afccb&lt;BR /&gt;
00:30:65:2a:fc:cb&lt;BR /&gt;
00-30-65-2a-fc-cb&lt;BR /&gt;
00 30 65 2a fc cb&lt;BR /&gt;
0030.652a.fccb&lt;BR /&gt;
and have it search across the index for anything that matches (which could be in most of the above formats), and display the log messages that match.  For the sake of simplicity, we'll say the index=network (but it's really several indexes)  Not all of the MAC addresses are parsed into searchable fields in all the indexes, so we are free-text searching.&lt;/P&gt;

&lt;P&gt;My thought is the best way to accomplish this is to:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;In the form, the user enters (or pastes) the MAC address into the field, giving it the token of $mac_address$.&lt;/LI&gt;
&lt;LI&gt;Take the entered MAC and convert it to a concatenated mac, (i.e. 0030652afccb) for easy rex'ing.  (tested - this works, thanks @wrangler2x )
&lt;CODE&gt;eval MAC=replace("$mac_address$","[\s.:-]","")&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;extract the 6 octets of the MAC address into 6 fields - (tested and works)
&lt;CODE&gt;rex field=MAC "^(?&amp;lt;octet1&amp;gt;..)(?&amp;lt;octet2&amp;gt;..)(?&amp;lt;octet3&amp;gt;..)(?&amp;lt;octet4&amp;gt;..)(?&amp;lt;octet5&amp;gt;..)(?&amp;lt;octet6&amp;gt;..)$"&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Perform a search using the contents of the 6 extracted octet fields (this is where I'm stuck) - 
&lt;CODE&gt;index=network "$octet1$:$octet2$:$octet3$:$octet4$:$octet5$:$octet6$" OR "$octet1$-$octet2$-$octet3$-$octet4$-$octet5$-$octet6$" OR "$octet1$$octet2$.$octet3$$octet4$.$octet5$$octet6$" OR "$octet1$$octet2$$octet3$$octet4$$octet5$$octet6$"&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I'm stuck trying to get the 6 extracted octet values to populate the search in step 3.  If this matters, I'm building it in an XML form, but only the search query isn't working..&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2017 19:45:31 GMT</pubDate>
    <dc:creator>rpquinlan</dc:creator>
    <dc:date>2017-11-06T19:45:31Z</dc:date>
    <item>
      <title>How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353263#M104550</link>
      <description>&lt;P&gt;I'm still pretty new so the answer is probably easy, but am stuck trying to making this search form work.  The goal is to allow our users to enter a MAC address in any format such as:&lt;BR /&gt;
0030652afccb&lt;BR /&gt;
00:30:65:2a:fc:cb&lt;BR /&gt;
00-30-65-2a-fc-cb&lt;BR /&gt;
00 30 65 2a fc cb&lt;BR /&gt;
0030.652a.fccb&lt;BR /&gt;
and have it search across the index for anything that matches (which could be in most of the above formats), and display the log messages that match.  For the sake of simplicity, we'll say the index=network (but it's really several indexes)  Not all of the MAC addresses are parsed into searchable fields in all the indexes, so we are free-text searching.&lt;/P&gt;

&lt;P&gt;My thought is the best way to accomplish this is to:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;In the form, the user enters (or pastes) the MAC address into the field, giving it the token of $mac_address$.&lt;/LI&gt;
&lt;LI&gt;Take the entered MAC and convert it to a concatenated mac, (i.e. 0030652afccb) for easy rex'ing.  (tested - this works, thanks @wrangler2x )
&lt;CODE&gt;eval MAC=replace("$mac_address$","[\s.:-]","")&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;extract the 6 octets of the MAC address into 6 fields - (tested and works)
&lt;CODE&gt;rex field=MAC "^(?&amp;lt;octet1&amp;gt;..)(?&amp;lt;octet2&amp;gt;..)(?&amp;lt;octet3&amp;gt;..)(?&amp;lt;octet4&amp;gt;..)(?&amp;lt;octet5&amp;gt;..)(?&amp;lt;octet6&amp;gt;..)$"&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Perform a search using the contents of the 6 extracted octet fields (this is where I'm stuck) - 
&lt;CODE&gt;index=network "$octet1$:$octet2$:$octet3$:$octet4$:$octet5$:$octet6$" OR "$octet1$-$octet2$-$octet3$-$octet4$-$octet5$-$octet6$" OR "$octet1$$octet2$.$octet3$$octet4$.$octet5$$octet6$" OR "$octet1$$octet2$$octet3$$octet4$$octet5$$octet6$"&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I'm stuck trying to get the 6 extracted octet values to populate the search in step 3.  If this matters, I'm building it in an XML form, but only the search query isn't working..&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 19:45:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353263#M104550</guid>
      <dc:creator>rpquinlan</dc:creator>
      <dc:date>2017-11-06T19:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353264#M104551</link>
      <description>&lt;P&gt;Are you sure that step #2 is producing the results you want? That seems like a question about something obvious, but your step #3 seems to be fine. That's why I ask that question.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 20:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353264#M104551</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-11-06T20:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353265#M104552</link>
      <description>&lt;P&gt;When I added something like this to the search&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| table octet1,octet2,octet3,octet4,octet5,octet6,_raw&lt;/CODE&gt;  &lt;/P&gt;

&lt;P&gt;it did populate those 6 columns with a broken out version of the MAC address I entered..  Perhaps I'm just failing in trying to create the entire search string?&lt;/P&gt;

&lt;P&gt;My whole query is:&lt;BR /&gt;
 &lt;CODE&gt;index=network "$octet1$:$octet2$:$octet3$:$octet4$:$octet5$:$octet6$" OR "$octet1$-$octet2$-$octet3$-$octet4$-$octet5$-$octet6$" OR "$octet1$$octet2$.$octet3$$octet4$.$octet5$$octet6$" OR "$octet1$$octet2$$octet3$$octet4$$octet5$$octet6$"&lt;BR /&gt;
              | eval MAC=replace("$mac_address$","[\s.:-]","")&lt;BR /&gt;
              | rex field=MAC "^(?&amp;lt;octet1&amp;gt;..)(?&amp;lt;octet2&amp;gt;..)(?&amp;lt;octet3&amp;gt;..)(?&amp;lt;octet4&amp;gt;..)(?&amp;lt;octet5&amp;gt;..)(?&amp;lt;octet6&amp;gt;..)$"&lt;/CODE&gt; &lt;BR /&gt;
But when I submit this, nothing happens..  "Search is waiting for input"&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 20:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353265#M104552</guid>
      <dc:creator>rpquinlan</dc:creator>
      <dc:date>2017-11-06T20:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353266#M104553</link>
      <description>&lt;P&gt;I typo'd the original question.&lt;/P&gt;

&lt;P&gt;What I meant to say was "I'm stuck trying to get the 6 extracted octet values to populate the search in step &lt;STRONG&gt;4&lt;/STRONG&gt;"&lt;BR /&gt;
1, 2, 3 seem to be doing what I need them to.  Sorry about that!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 21:21:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353266#M104553</guid>
      <dc:creator>rpquinlan</dc:creator>
      <dc:date>2017-11-06T21:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353267#M104554</link>
      <description>&lt;P&gt;Hey @rpquinlan, Can you let me know approximately what time you posted when your comment disappeared? I'll investigate the platform records. &lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 21:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353267#M104554</guid>
      <dc:creator>lfedak_splunk</dc:creator>
      <dc:date>2017-11-06T21:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353268#M104555</link>
      <description>&lt;P&gt;Browser cache issue I think..  it's there now..  my apologies.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 21:26:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353268#M104555</guid>
      <dc:creator>rpquinlan</dc:creator>
      <dc:date>2017-11-06T21:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353269#M104556</link>
      <description>&lt;P&gt;So the values for the octets need to be in tokens in order to use $octet1$ (for example). Have you done that in your dashboard?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 23:10:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353269#M104556</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-11-06T23:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353270#M104557</link>
      <description>&lt;P&gt;Run each of the tests one at a time and see which one kills it.  I believe the issue may be with the last one,  because I've had problems with two tokens together.  The middle dollar signs together might be what is messing it up.   You may have to extract the double-octets separately and use them that way.   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$octet1$$octet2$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Nov 2017 23:35:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353270#M104557</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-11-06T23:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353271#M104558</link>
      <description>&lt;P&gt;I'm quite sure I have not done that.  Are you able to help with how, since the octets are created by the rex in the query?  I'm stuck trying to figure that out.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 13:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353271#M104558</guid>
      <dc:creator>rpquinlan</dc:creator>
      <dc:date>2017-11-07T13:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can we make multiple MAC address formats be readable in one search, regardless of format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353272#M104559</link>
      <description>&lt;P&gt;@rpquinlan did you ever get this figured out?&lt;BR /&gt;
I am also trying to do a multi-format search via dashboard and I got about as far as your last post.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 17:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-make-multiple-MAC-address-formats-be-readable-in-one/m-p/353272#M104559</guid>
      <dc:creator>richardphung</dc:creator>
      <dc:date>2018-12-17T17:11:03Z</dc:date>
    </item>
  </channel>
</rss>

