Splunk Search

How to forward separate keys and values from a Splunk forwarder?

Markus
Engager
I use a PowerShell script in a Splunk forwarder that sends data with
Write-Output $line
Splunk receives this data in the _raw field.
 
How shall a PowerShell script write key-value pairs, so that for Splunk there are separate keys and values instead of _raw?
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Anything written by a script to stdout is indexed as a raw event by Splunk.  You can use props.conf settings to extract fields from the event.  By default, Splunk will extract key and values that are in key=value format, so perhaps your PS script could do that.

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

View solution in original post

Markus
Engager

I go with the default indexing of raw.

However, I had to change my output from key1=value1,key2=value2,key3=value3 (no space after comma) into key1=value1, key2=value2, key3=value3 (space after comma)

richgalloway
SplunkTrust
SplunkTrust

Anything written by a script to stdout is indexed as a raw event by Splunk.  You can use props.conf settings to extract fields from the event.  By default, Splunk will extract key and values that are in key=value format, so perhaps your PS script could do that.

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

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...