|
We have different log sources that may format the MAC address as:
In order to search for a MAC address across these sources, I created added
to my transforms.conf so that the format would be normalized. As a result, each log entry with a valid MAC address is extracted with the literal " |
|
I have found that while the format you did above works for index-time extractions, it does not work for search time. Possibly a "bug". I've searched for things like this by instead creating a macro, e.g.:
and searching with it like:
Actually, it's really not a bug, it's an expected behavior due to limitations on how extracted fields are searched for in the index. Might be a useful enhancement request though.
(26 Mar '10, 02:52)
gkanapathy ♦
Yeah, that works... though I'd like it better if it worked using the method in my example above... Think you're right. I'll put it in as an enhancement request as soon as we become paying customers.
(30 Mar '10, 16:31)
jeff
|
|
Found the answer, but not where I was expecting. It seems--correct me if I'm wrong--that SEDCMD does not work on events forwarded from another system. I moved my SEDCMD from the index host--where it was NOT working--to the forwarder, and presto! it came good. This is not documented as far as I can see, unless it's buried somewhere in the discussion of the pipeline. I'm quite happy to subst the whole output from getmac.exe, since I throw away most of it and keep the mac address--the field extraction on the index server DOES work. This would be nice to have in the windows app, so you can align mac addresses in a multi-platform shop. Also, if windows had utilities like sed built-in, none of this would be necessary since you could do it all in the script, like on a real OS. Anyway, the complete solution if anyone is interested: On windows host--input and rewrite -- create $SPLUNKbinscriptsgetmac.cmd
-- add an input to etcsystemlocalinputs.conf
-- add sedcmd to etcsystemlocalprops.conf
On indexer: field extraction
Result: maximum joy 19/08/2011 11:44:06.000 00:16:3E:23:E8:09 DeviceTcpip_{60AE15D3:02BD:4E10:8D86:D1FECF394DAB} Looks like the forum software has eaten the backslash characters in the above post. Sigh.
(18 Aug '11, 18:52)
cmeo
yet another variation on theme. The above solution only works on a heavy forwarder. Now that I've deployed some Universal Forwarders, you CAN'T use sedcmd there, evidently because the apparatus to make it go isn't there. HOWEVER, now it DOES work on the indexer. Can someone from splunk please explain these interactions?
(28 Sep '11, 23:47)
cmeo
|
|
This can be solved by a scripted lookup, and you can apply it to entire sources or sourcetypes. (Be sure to extract the mac as messy_mac or change that to your non-normalized-mac field name.) bin/normalizemac.py
local/transforms.conf
local/props.conf
|
|
Is there no simpler way to do this? Grappling with the same problem... I tried this in props.conf but it didn't do anything: SEDCMD-fixmac=s/-/:/g This is index-time, which is fine...if it worked. Input is from windows, which provides aa-bb-cc-dd-ee-ff |
