Deployment Architecture

Why does Splunk only run my PowerShell script once after reloading the deployment server?

wstefanczyk
Engager

I'm a new Splunk user.

I created a new Powershell script and i don't know why Splunk runs it only once after reloading the Deployment Server

My input file:

[powershell://dq]
script = . "$SplunkHome\etc\apps\wins_inputs\local\dq.ps1"
source = dq
sourcetype = Powershell:dq
interval = 10
index = powershell

Powershell script:
dq.ps1

$computer         = $ENV:Computername
$instance         = "_total"

@("\\$Computer\PhysicalDisk(*)\Current Disk Queue Length",
  "\\$Computer\PhysicalDisk(*)\Avg. Disk Queue Length",
  "\\$Computer\PhysicalDisk(*)\Avg. Disk Read Queue Length",
  "\\$Computer\PhysicalDisk(*)\Avg. Disk Write Queue Length") |% {
    (Get-Counter $_.replace("*",$instance)).CounterSamples } |
    Select-Object Path,CookedValue

Do you have any ideas why?

0 Karma
1 Solution

wstefanczyk
Engager

I found resolutions

i used schedule not interval

View solution in original post

0 Karma

wstefanczyk
Engager

I found resolutions

i used schedule not interval

0 Karma

SudarshanChakra
Loves-to-Learn

Hi 

I have tried using both interval and schedule but the script only runs on splunk restart or after reloading the deployment server. Any suggestions ? 

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...