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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...