Getting Data In

Why can't Splunk continuously index data from a powershell input?

yutaka1005
Builder

Splunk ver : 6.6.6
OS : Linux 7

Universal Forwarder ver : 6.6.6
OS : Windows Server 2016

I configured below inputs.conf and sample.ps1 in the Universal Forwarder and Splunk indexed once, but after that, no more events were indexed.

inputs.conf

[powershell://power_shell_sapmle]
script = . "$SplunkHome\etc\apps\sample_app\bin\sample.ps1"
interval = */1 * * * *
sourcetype = power_shell_sapmle

sample.ps1

$Output = invoke-expression "wmic cpu list brief"
Write-Output $Output

Is my configuration wrong?

Please someone help me.

0 Karma
1 Solution

deepashri_123
Motivator

Hey@yutaka1005,

As per the docs, default the script executes only once.
To schedule the script, you can try using parameter

schedule=<cron>

https://docs.splunk.com/Documentation/Splunk/7.2.3/Data/MonitorWindowsdatawithPowerShellscripts

Let me know if this helps!!

View solution in original post

deepashri_123
Motivator

Hey@yutaka1005,

As per the docs, default the script executes only once.
To schedule the script, you can try using parameter

schedule=<cron>

https://docs.splunk.com/Documentation/Splunk/7.2.3/Data/MonitorWindowsdatawithPowerShellscripts

Let me know if this helps!!

yutaka1005
Builder

Thank you for answer!

I did not check the manual properly ...
It was very helpful.

0 Karma
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 ...