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!

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...

We’ve Got Education Validation!

Are you feeling it? All the career-boosting benefits of up-skilling with Splunk? It’s not just a feeling, it's ...