Splunk Enterprise

Powershell scripted input debug logging

atownson
Explorer

Does anyone know how to log INFO and WARN log_level events to $SplunkHome\var\log\splunk\splunk-powershell.ps1.log or $SplunkHome\var\log\splunk\splunkd.log for debug purposes using the powershell input?

Using the code below in the script terminates it:

 

Write-Error -Message 'INFO test'

 

 

 

10-16-2020 12:47:05.4859538-5 ERROR Executing script=& "$SplunkHome/etc/apps/foo/bin/foo.ps1" for stanza=foo failed with exception=INFO test

 

The script does run correctly. I would just like to have some debug options. Thanks. 

Labels (1)
Tags (3)
0 Karma

jeremyhagand61
Communicator

Did you ever work this out? I've tried Write-Warning, but the output didn't go into the log or into the indexed output

0 Karma
Get Updates on the Splunk Community!

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...