Logstash nssm service error

hi guys need some help new to elk . my logstash works fine when i run in cmd but when i start it from windows service i get errors .

Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-07-16T23:02:03,249][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.2.0"}
[2019-07-16T23:02:03,857][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 17, column 1 (byte 407) after #!/bin/bash\n# Run logstash from source\n#\n# This is most useful when done from a git checkout.\n#\n# Usage:\n# bin/logstash [arguments]\n#\n# See 'bin/logstash --help' for a list of commands.\n#\n# Supported environment variables:\n# LS_JAVA_OPTS="xxx" to append extra options to the JVM options provided by logstash\n#\n# Development environment variables:\n# DEBUG=1 to output debugging information\n\n", :backtrace=>["E:/ELK/logstash/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "E:/ELK/logstash/logstash-core/lib/logstash/compiler.rb:49:incompile_graph'", "E:/ELK/logstash/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2577:inmap'", "E:/ELK/logstash/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:ininitialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "E:/ELK/logstash/logstash-core/lib/logstash/java_pipeline.rb:24:ininitialize'", "E:/ELK/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "E:/ELK/logstash/logstash-core/lib/logstash/agent.rb:325:inblock in converge_state'"]}
[2019-07-16T23:02:04,102][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2019-07-16T23:02:09,065][INFO ][logstash.runner ] Logstash shut down.

my pipeline.yml file

  • pipeline.id: pipeline-http
    pipeline.workers: 1
    path.config: "/ELK/logstash/config/logstash_http_elasticsearch.conf"
  • pipeline.id: pipeline-filebeat
    pipeline.workers: 1
    path.config: "/ELK/logstash/config/logstash_filebeat_elasticsearch.conf"

Thankyou

This suggests that you have put the script used to run logstash in path.config and that path.config points to a directory, so it is reading every file in the directory.

Note also that it is pipelines.yml (plural) but logstash will ignore that until you remove the -f from the command line when you start it.

Thanks Badger but i didnt totally get you . this is my nssm setting .Can you please tell me how can i fix this thing

nssm

Remove -f and the filename from the Application Arguments

ok thanks
Please correct me if i'm wrong .I thought arguments are certain set of commands we want to pass .

So should i just put logstash in the arguments ?

In NSSM, Path is the command that is run. Arguments are passed to the command that is run. You do not want -f and a filename in your arguments.

oh thanks

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