Alerting

Error Code 1 when running .bat script in response to an alert

jospina2
Explorer

I set up an alert so that when it triggers it runs a script called test.bat (this is a windows environment) which is located in $SPLUNK_HOME/bin/scripts. The .bat script is just a one liner that says "echo hello"

splunkd.log shows this error when it tries to execute it:
08-14-2018 17:09:07.268 -0700 ERROR script - sid:scheduler_jeff_search_RMD581e2e8e1bcfdf00c_at_1534291740_150 command="runshellscript", Script: C:\Program Files\Splunk\bin\scripts\test.bat exited with status code: 1

This is how I have my alert setup (see picture) - any help is appreciated.

alt text

Tags (1)
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!

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Splunk Developer Day announcements: AI agents, MCP tools, Forecasting, and Custom ...

Splunk Developer Day was packed with product and platform updates for developers building in the AI ...