Splunk Search

How do I create a Field for Mac Address?

mayler
Path Finder

The mac address format for all of my logs is xx:xx:xx:xx:xx:xx

AUTHORIZATION-SUCCESS: user: airport; mac: e8:06:88:8a:17:97; author reason: new session; ssid: slo_airport; AP 32/1

AUTHORIZATION-SUCCESS: user: airport; mac: 00:1c:b3:be:08:2c; author reason: new session; ssid: slo_airport; AP 32/2

I'm trying to " my search string " | stats distinct_count(mac)

I would think that the mac address would be a "pre-built" field. Thanks.

1 Solution

ftk
Motivator

You can extract the mac address using rex as such:

your search string | rex "mac: (?<mac>\S+);" | stats distinct_count(mac)

View solution in original post

ftk
Motivator

You can extract the mac address using rex as such:

your search string | rex "mac: (?<mac>\S+);" | stats distinct_count(mac)

mayler
Path Finder

Thank you very very very much.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...