<?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: Autoformat and search results similar to &amp;quot;48a4.93b9.xxxx OR 48:a4:93:b9:xx:xx OR 48-a4-93-b9-xx-xx&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/747825#M241902</link>
    <description>&lt;P&gt;Your first replace effectively reduces the string to 8 characters and the subsequent replaces are expecting 12 characters so the replaces fail. Also, using map is tricky at the best of times, perhaps you could try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main sourcetype=syslog [| makeresults
| eval input_mac="48a4.93b9.xxxx"
| eval mac_clean=lower(replace(input_mac, "[^0-9A-Fa-f]", ""))
| eval mac_colon=replace(mac_clean, "(..)(..)(..)(..)", "\1:\2:\3:\4:")
| eval mac_hyphen=replace(mac_clean, "(..)(..)(..)(..)", "\1-\2-\3-\4-")
| eval mac_dot=replace(mac_clean, "(....)(....)", "\1.\2.")
| eval query=mvappend(mac_colon, mac_hyphen, mac_dot)
| mvexpand query
| table query]
| table _time host _raw"&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 11 Jun 2025 15:33:30 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2025-06-11T15:33:30Z</dc:date>
    <item>
      <title>Autoformat and search results similar to "48a4.93b9.xxxx OR 48:a4:93:b9:xx:xx OR 48-a4-93-b9-xx-xx"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/747819#M241896</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;This search returns zero results, but a manual "OR" search shows results. I cannot find the reason (neither can ChatGPT). The end result would be a query where I can input any format of MAC address in one section, but automatically search for all formats shown.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any guidance would be appreciated. BTW, this is a local Splunk installation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Please ignore the "xxxx".)&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval input_mac="48a4.93b9.xxxx"&lt;BR /&gt;| eval mac_clean=lower(replace(input_mac, "[^0-9A-Fa-f]", ""))&lt;BR /&gt;| eval mac_colon=replace(mac_clean, "(..)(..)(..)(..)(..)(..)", "\1:\2:\3:\4:\5:\6")&lt;BR /&gt;| eval mac_hyphen=replace(mac_clean, "(..)(..)(..)(..)(..)(..)", "\1-\2-\3-\4-\5-\6")&lt;BR /&gt;| eval mac_dot=replace(mac_clean, "(....)(....)(....)", "\1.\2.\3")&lt;BR /&gt;| fields mac_clean mac_colon mac_hyphen mac_dot&lt;BR /&gt;| eval search_string="\"" . mac_clean . "\" OR \"" . mac_colon . "\" OR \"" . mac_hyphen . "\" OR \"" . mac_dot . "\""&lt;BR /&gt;| table search_string&lt;BR /&gt;| map search="search index=main sourcetype=syslog ($search_string$) | table _time host _raw"&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 13:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/747819#M241896</guid>
      <dc:creator>anthonyi</dc:creator>
      <dc:date>2025-06-11T13:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Autoformat and search results similar to "48a4.93b9.xxxx OR 48:a4:93:b9:xx:xx OR 48-a4-93-b9-xx-xx"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/747825#M241902</link>
      <description>&lt;P&gt;Your first replace effectively reduces the string to 8 characters and the subsequent replaces are expecting 12 characters so the replaces fail. Also, using map is tricky at the best of times, perhaps you could try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main sourcetype=syslog [| makeresults
| eval input_mac="48a4.93b9.xxxx"
| eval mac_clean=lower(replace(input_mac, "[^0-9A-Fa-f]", ""))
| eval mac_colon=replace(mac_clean, "(..)(..)(..)(..)", "\1:\2:\3:\4:")
| eval mac_hyphen=replace(mac_clean, "(..)(..)(..)(..)", "\1-\2-\3-\4-")
| eval mac_dot=replace(mac_clean, "(....)(....)", "\1.\2.")
| eval query=mvappend(mac_colon, mac_hyphen, mac_dot)
| mvexpand query
| table query]
| table _time host _raw"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 11 Jun 2025 15:33:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/747825#M241902</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-06-11T15:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Autoformat and search results similar to "48a4.93b9.xxxx OR 48:a4:93:b9:xx:xx OR 48-a4-93-b9-xx-xx"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/747834#M241904</link>
      <description>&lt;P&gt;Thank you! That gave me the proper direction to go!&lt;/P&gt;&lt;P&gt;My final, validated version is...&lt;/P&gt;&lt;P&gt;index=main sourcetype=syslog&lt;BR /&gt;[&lt;BR /&gt;| makeresults&lt;BR /&gt;| eval input_mac="48a4.93b9.xxxx"&lt;BR /&gt;| eval mac_clean=lower(replace(input_mac, "[^0-9A-Fa-f]", ""))&lt;BR /&gt;| where len(mac_clean)=12&lt;BR /&gt;| eval mac_colon=replace(mac_clean, "(..)(..)(..)(..)(..)(..)", "\1:\2:\3:\4:\5:\6")&lt;BR /&gt;| eval mac_hyphen=replace(mac_clean, "(..)(..)(..)(..)(..)(..)", "\1-\2-\3-\4-\5-\6")&lt;BR /&gt;| eval mac_dot=replace(mac_clean, "(....)(....)(....)", "\1.\2.\3")&lt;BR /&gt;| eval query=mvappend(mac_clean, mac_colon, mac_hyphen, mac_dot)&lt;BR /&gt;| mvexpand query&lt;BR /&gt;| where isnotnull(query)&lt;BR /&gt;| fields query&lt;BR /&gt;| format&lt;BR /&gt;]&lt;BR /&gt;| table _raw&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 16:25:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/747834#M241904</guid>
      <dc:creator>anthonyi</dc:creator>
      <dc:date>2025-06-11T16:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Autoformat and search results similar to "48a4.93b9.xxxx OR 48:a4:93:b9:xx:xx OR 48-a4-93-b9-xx-xx"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/748024#M241932</link>
      <description>&lt;P&gt;Just a quick update to my final saved search, which allows a simple double-click and paste of a new MAC in any format, but will never return a result initially. I am using this as a report.&lt;/P&gt;&lt;P&gt;index=main sourcetype=syslog&lt;BR /&gt;[&lt;BR /&gt;| makeresults&lt;BR /&gt;| eval input_mac="INPUT_HERE"&lt;BR /&gt;| eval mac_clean=lower(replace(input_mac, "[^0-9A-Fa-f]", ""))&lt;BR /&gt;| where len(mac_clean)=12&lt;BR /&gt;| eval mac_colon=replace(mac_clean, "(..)(..)(..)(..)(..)(..)", "\1:\2:\3:\4:\5:\6")&lt;BR /&gt;| eval mac_hyphen=replace(mac_clean, "(..)(..)(..)(..)(..)(..)", "\1-\2-\3-\4-\5-\6")&lt;BR /&gt;| eval mac_dot=replace(mac_clean, "(....)(....)(....)", "\1.\2.\3")&lt;BR /&gt;| eval query=mvappend(mac_clean, mac_colon, mac_hyphen, mac_dot)&lt;BR /&gt;| mvexpand query&lt;BR /&gt;| where isnotnull(query)&lt;BR /&gt;| fields query&lt;BR /&gt;| format&lt;BR /&gt;]&lt;BR /&gt;| table _raw&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 13:24:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Autoformat-and-search-results-similar-to-quot-48a4-93b9-xxxx-OR/m-p/748024#M241932</guid>
      <dc:creator>anthonyi</dc:creator>
      <dc:date>2025-06-16T13:24:04Z</dc:date>
    </item>
  </channel>
</rss>

