Getting Data In

sedcmd for part of the string in props.conf

nathanpaul8
New Member

I need to anonymize ES credentials going to syslog
I need to redact only the password and leave the user name -u admin:passsword
like -u [^:]:[^\s]

Can I use sedcmd for this .

I see samples if value of admin is fixed. Need to leave that value.

Thanks in advance.

0 Karma
1 Solution

mayurr98
Super Champion

Try this run anywhere search

| makeresults 
| eval _raw="user name -u nathanpaul8:xczveffd" 
| rex field=_raw mode=sed "s/(-u\s[^\:]+\:)([^\s]+)/\1XXXXX/g"

In props.conf on indexer/heavy forwarder, you need to put

[<your_sourcetype>]
SEDCMD-password = s/(-u\s[^\:]+\:)([^\s]+)/\1XXXXX/g

let me know if this helps!

View solution in original post

nathanpaul8
New Member

Thanks to both.

0 Karma

mayurr98
Super Champion

Try this run anywhere search

| makeresults 
| eval _raw="user name -u nathanpaul8:xczveffd" 
| rex field=_raw mode=sed "s/(-u\s[^\:]+\:)([^\s]+)/\1XXXXX/g"

In props.conf on indexer/heavy forwarder, you need to put

[<your_sourcetype>]
SEDCMD-password = s/(-u\s[^\:]+\:)([^\s]+)/\1XXXXX/g

let me know if this helps!

493669
Super Champion

Try this:
in props.conf on Indexer/Heavy Forwarder

[sourcetype]
 SEDCMD-cc = s/(?i)(-u\s[^\:]+\:)\w+/\1xxxxxxx/g
0 Karma

nathanpaul8
New Member

Thanks to both. realized I am using another TRANSFORMER for the same source. . started managing splunk couple of months ago. Can I use both TRANSORMER and sedcmd?.

0 Karma

493669
Super Champion
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, ...