How to run Logstash with batch file through Task scheduler

I have created a bacth file and tried to call it through Task scheduler. It is giving an error unable to launch. but am able to run manually(Without Scheduler) Its perfectly working .

Below is code for Batch :

@echo off

set root=F:\logstash-7.6.1\logstash-7.6.1\bin

CD %root%

call logstash -f F:\logstash-7.6.1\logstash-7.6.1\config\logstash_delta.conf

exit /B 0

You need to capture the output of the scheduled task (including stderr). logstash will be logging an error, maybe something like being unable to find java in the PATH.

See this Q&A for advice. I definitely recommend the second answer over the first (i.e. include the 2>&1)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.