Getting Data In

How to redact the description field from the Service WinHostMon?

JChris_
Path Finder

I'm trying to redact the description field from the Service WinHostMon to have something like that:

Before:

 

 

 

Type=Service
Name="LoremIpsum"
DisplayName="Lipsum service"
Description="Bla bla bla bla bla."
Path="C:\path\to\software.exe"
ServiceType="Unknown"
StartMode="Manual"
Started=false
State="Stopped"
Status="OK"
ProcessId=123

 

 

 

 

After:

 

 

 

Type=Service
Name="LoremIpsum"
DisplayName="Lipsum service"
Description="redacted"
Path="C:\path\to\software.exe"
ServiceType="Unknown"
StartMode="Manual"
Started=false
State="Stopped"
Status="OK"
ProcessId=123

 

 

 

 

I have a Windows host running Splunk UF, which then sends the data to a Splunk HF, which then sends it to Splunk Cloud. In the Splunk HF I already tried 2 approaches, both failed:

 

Approach 1:

Splunk HF > system/local/props.conf

 

 

 

[source::service]
SEDCMD-redact=s/\/Description=.+\n/\/Description="redacted"\n/g

 

 

 

 

Approach 2:

Splunk HF > system/local/props.conf

 

 

 

[source::service]
TRANSFORMS-my_transf = remove-desc

 

 

 

 

Splunk HF > system/local/transforms.conf

 

 

 

[remove-desc]
REGEX = (?mi)((?:.|\n)+Description=).+(\n(?:.|\n)+)
FORMAT = $1"redacted"$2
DEST_KEY = _raw

 

 

 

 

So, how can I redact the description field?

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

SEDCMD will work with the right regex.  Linefeeds are removed by the default line breaker so a regex is unlikely to find them.  Try this, instead.

 

[source::service]
SEDCMD-redact=s/Description=".+"/Description="redacted"/

 

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

SEDCMD will work with the right regex.  Linefeeds are removed by the default line breaker so a regex is unlikely to find them.  Try this, instead.

 

[source::service]
SEDCMD-redact=s/Description=".+"/Description="redacted"/

 

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...