Getting Data In

Need help executing a script with powershell v3 Modular Input

ribicU
Engager

Could somebody help me with this problem, i have simple powershell script:

Write-Host "Num Args:" $args.Length;
foreach ($arg in $args)
{
  Write-Host "Arg: $arg";
}

and i'm trying to execute with Powershell v3 Modular Input, but i don't know how. In Command or Script Path field says put full path to a script, i did it, but it is not working.

0 Karma
1 Solution

DennisFFM
Explorer

Hi @ribicU, I think it's because your script is not returning something.
"Write-Host" is only printing to console.
Try "Write-Output" instead or save your values to a variable and "return" it in the end.

Dennis

View solution in original post

DennisFFM
Explorer

Hi @ribicU, I think it's because your script is not returning something.
"Write-Host" is only printing to console.
Try "Write-Output" instead or save your values to a variable and "return" it in the end.

Dennis

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...