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!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...