Splunk Dev

Regex for field ending with $

cr32003
New Member

I am trying to filter out WMI events that have the 'User' field whicxh ends with a $ i.e a special character as far as regex is concerned.I am running Splunk version 4.2.2 on a windows 2003 server (virtualised).
my 'local' 'props.conf' is set to:-

[WMI:WinEventLog:Security]
TRANSFORMS-wmi=wmiExcludeUsers

[WMI:WinEventLog:Security]
TRANSFORMS-wmi=wmiExcludeEventCodes

and my 'local' 'transforms.conf' is set to:-

[wmiExcludeEventCodes]
REGEX=(?m)^EventCode=(512|513|514|515)
DEST_KEY=queue
FORMAT=nullQueue 

[wmiExcludeUsers]
REGEX=(?m)^User=\$$
DEST_KEY=queue
FORMAT=nullQueue 

I am fairly sure that the EventCodes bit is working but the Users bit is not.

0 Karma

cr32003
New Member

I have now tried pretty much all of the conbinations, including the one(s) above BUT if i put in the EventCode REGEX all is Hunky Dory and ANY changes made to the EventCode numbers are reflected in the indexing.
However if I then remove the EventCode REGEX and insert the User REGEX (either your version above or my original version) into the SAME TRANSFORMS Stanza then Splunk in its wisdom still indexes all of the events with the User field ending in '$'.
The MOST annoying thing is that if I do the following search:-
source="WMI:WinEventLog:Security" | regex User="\$$"
Then the results are all events with the User field ending in '$'.
Is there any 'debugging' tools to see what Splunk is actually doing when it receives the event and makes the decision as to whether to either index it or not?

0 Karma

MHibbin
Influencer

How abut something like this... I don't think you need to have two stanzas in the props.conf as they are the same sourcetype (have you checked the sourcetype is correct in Splunk?).

[WMI:WinEventLog:Security]
TRANSFORMS-wmievents = wmieventsnull 
TRANSFORMS-wmiusers = wmiusersnull

[wmieventsnull] 
REGEX = (?m)^User=(.*\$) 
DEST_KEY = queue 
FORMAT = nullQueue

[wmiexcludenull] 
REGEX = (?m)^EventCode=(512|513|514|515) 
DEST_KEY = queue 
FORMAT = nullQueue

(Thanks to Ayn for correction!)

0 Karma

MHibbin
Influencer

Ah ok, I wasn't sure, because you can have a transforms like...

TRANSFORMS-wmi = wmievents, wmiusers

Can't you?

0 Karma

Ayn
Legend

The TRANSFORMS sections should have a unique identifier, so for instance TRANSFORMS-wmievents and TRANSFORMS-wmiusers.

0 Karma

MHibbin
Influencer

Why don't you replace the "$$" with ".*\$" This should take anything up to $.

0 Karma

cr32003
New Member

Sorry the copy/paste bit obviuosly did not work correctly
the regex should read 'REGEX=(?m)^User=\$$' which i thought should be any "user value ending in '$'". I have tried changing this to what you suggested and it still has no affect.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

    Thursday, June 25, 2026  |  11AM PDT / 2PM EDT  Duration: 1 Hour (Includes live Q&A) Register to ...

Analytics Workspace deprecation

As of Splunk Cloud Platform 10.4.2604 and Splunk Enterprise 10.4, Analytics Workspace is now deprecated. ...

Splunk Developer Day Recap: Building, Publishing, and Growing on the Splunk Platform

Splunk Developer Day brought the Splunk developer community together for a practical look at what it means to ...