Getting Data In

Why are certain Powershell scripts running and others not?

damo66a
Explorer

I'm trying to get data in from a server via a powershell script. I have another app already doing similar on the same server but for some reason (that is driving me up the wall) i constantly get the error:

 

 

ERROR Executing script=. "$SplunkHome\etc\apps\vmwareinventory\appserver\static\vmguests.ps1" for stanza=VMWare-Guests failed with exception=The system cannot find the path specified.

 

I have checked and double checked the spellings, the system variables (for Splunk_Home), renamed the files, the directories and still it comes up with this error. I have followed the instructions to the letter from the Splunk Documentation and still the error persists.

 

This is my input stanza:

 

[powershell://VMWare-Guests]
script = . "$SplunkHome\etc\apps\vmwareinventory\appserver\static\vmguests.ps1"
schedule = 30 0 * * *
sourcetype = vm:inventory
index = vmware
disabled = false

 

 

Can someone please tell me why this would be happening with this script but not others on the same server?

 

TIA

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @damo66a,

the variables is "$SPUNK_HOME" and not "$SplunkHome", please try using the correct variables or the absolute path.

Ciao.

Giuseppe

0 Karma

damo66a
Explorer

Hi @gcusello 

 

Thanks for your input. In terms of correct variables, this is what is in the instructions on the Splunk Documentation located here

I will try what you say but I have simply followed the instructions.

 

D

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @damo66a,

I'm not a PowerShell expert, but let me know if you solved changing the variable.

Ciao.

Giuseppe

0 Karma

damo66a
Explorer

so i changed the variable and it made no difference. we're still getting the same "cannot find file specified" error. 

 

we do have other scripts running on this server by Splunk so its somewhat confusing. 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @damo66a,

have you seen the Splunk TA Windows (https://splunkbase.splunk.com/app/742)?

then in splunkbase there's this app that I never used Hurricane Labs Add-on for Windows PowerShell Transcript (https://splunkbase.splunk.com/app/4984) that maybe can help you.

Ciao.

Giuseppe

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Supercharging Windows Security Detection Performance: Introducing Hybrid Field ...

Windows event logs—from Security auditing and Sysmon to PowerShell script blocks—form the operational backbone ...

Enriching Signals with the OTel Lookup Processor

Introduction Raw telemetry is often incomplete. A log line might record an IP address, but what you really ...

Meet the .conf26 AI Agent Buildathon Winners

At the .conf26 AI Agent Buildathon, Splunk users turned their operational expertise into working AI agents ...