Getting Data In

Splunk ExecProcessor can't find .bat script

Choi_Hyun
Explorer

Hello,

I have a simple .bat file that just performs a "dir" command to list everything in a folder. 

I have set the input.conf to the following:

 

[script://.\bin\ListDir.bat]
disabled = 0
## Run Every Ten Seconds
interval = 10
sourcetype = Script:ListDir
index = main

 

I have placed my ListDir.bat in the application's \bin\ folder.
When I run the command: splunk cmd ListDir.bat, splunk runs the bat files no problem, displaying all the files I want Splunk to ingest.

However, looking at my Splunkd logs, I see that ExecProcessor lists the exact location where the bat file exists and reads "The system cannot find the file specified."

 

ERROR ExecProcessor [11384 ExecProcessor] - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\Splunk_TA_Burn_Folder\bin\ListDir.bat"" The system cannot find the file specified.

 

I looked at the file permissions and I gave everyone access to this bat file.

Any help is appreciated.

Labels (2)
0 Karma
1 Solution

Choi_Hyun
Explorer

After few days of work, I figured out that the bat file literally could not find the file. Depending on who is running the bat file (SYSTEM in this case) it changed the environment variable and the folder did not exist.

View solution in original post

0 Karma

Choi_Hyun
Explorer

After few days of work, I figured out that the bat file literally could not find the file. Depending on who is running the bat file (SYSTEM in this case) it changed the environment variable and the folder did not exist.

0 Karma
Get Updates on the Splunk Community!

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...

New Year. New Skills. New Course Releases from Splunk Education

A new year often inspires reflection—and reinvention. Whether your goals include strengthening your security ...