Well, I'm answering my own question here, but hopefully it helps someone. I found the following thread, which does very similar to what I want:
http://splunk-base.splunk.com/answers/46247/how-to-extract-mac-address-field-from-cisco-mac-address-notification-traps
However, when I tried it it didn't work. I've managed to clean up the code and make it work:
rex "Hex-STRING:\s(?< action1 >[0-9]{2})\s(?< vlan_hex >[\sa-fA-F0-9]{5})\s(?< mac_address >[\sA-F0-9]{17})\s(?< card_hex >[\sA-F0-9]{2})\s(?< port_hex >[\sA-F0-9]{2})" | rex "UDP:\s\[(?< switch_ip >[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})" | eval ACTION2=replace(action1,"01","Added") | eval ACTION=replace(ACTION2,"02","Removed") | eval VLAN1=replace(vlan_hex,"\s","") | eval VLAN=tonumber(VLAN1, 16) | eval MAC-ADDRESS=replace(mac_address,"\s",":") | eval CARD1=replace(card_hex,"\s","") | eval CARD=tonumber(CARD1, 16) | eval PORT1=replace(port_hex,"\s","") | eval PORT=tonumber(PORT1, 16) | table _time, ACTION, VLAN, MAC-ADDRESS, CARD, PORT, switch_ip
(As before, ignore the spaces in the variables.)
I'm a little bummed still, in that the switches are being listed by their IP addresses. I had to do this as we don't have our switches listed in DNS. I do, however, have tags in splunk correlating host=[switch IP address] to hostnames, so if anyone has any ideas on how I can get my code above to replace switch_ip with the correlating tag, that would be awesome.
... View more