I will like to mask this data so that the password value is "XXXXXXXX". I have tried SEDCMD, scrub and transforms but I just couldn't get it done. Thanks for your help
Index time means you can never recover the value again. Splunk's official documentation to anonymize data
probable_password_sourcetype
)Example
[probable_password_sourcetype]
TRANSFORMS-anonymize = password-anonymizer
Example
[password-anonymizer]
REGEX = (?m)^(.*)password=\w+(\w{4}[&"].*)$
FORMAT = $1password=########$2
DEST_KEY = _raw
Index time means you can never recover the value again. Splunk's official documentation to anonymize data
probable_password_sourcetype
)Example
[probable_password_sourcetype]
TRANSFORMS-anonymize = password-anonymizer
Example
[password-anonymizer]
REGEX = (?m)^(.*)password=\w+(\w{4}[&"].*)$
FORMAT = $1password=########$2
DEST_KEY = _raw
Thanks @ koshyk for the insight. But I'm still having issues getting the sample data masked at index time.
Sample data to be masked : ns2:arg name="password" value="utTSsgTST9B"/
props.conf
[password_log]
TRANSFORMS-anonymize = password-anonymizer
transforms.conf
[password-anonymizer]
REGEX = (?m)^(.)"password"=\s\w+('[a-z0-9#])["/].)$
FORMAT = $1password=########$2
DEST_KEY = _raw
What am i doing wrong?
Thanks
-u
Good to see a sample data. Your regex seems wrong
Have a try below.
[password-anonymizer]
REGEX =(?m)^(.+)\svalue=\"([\w\W]+)\"(.*)$
FORMAT = $1 value=########$3
DEST_KEY = _raw
Thanks. It worked.
Please mark the answer as accepted if this works for you 😉