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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...