Logstash : error when running

Hello i jaust installed logsatsh-5.5.0 on my server then when i first tryed to run it by the command line bin/logstash -e 'input { stdin { } } output { stdout {} }'
many errors appeared 2017-07-19 09:54:23,269 main ERROR Unable to create file /opt/logstash-5.5.0/logs/logstash-slowlog-plain.log java.io.IOException: No such file or directory

Caused by: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@30591043] unable to create manager for [/opt/logstash-5.5.0/logs/logstash-slowlog-plain.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@1ecfdaf4[pattern=/opt/logstash-5.5.0/logs/logstash-slowlog-plain-%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=1, max=7), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c] %.10000m%n]]
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:75)
at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:81)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:103)
at org.apache.logging.log4j.core.appender.RollingFileAppender.createAppender(RollingFileAppender.java:191)
... 105 more

2017-07-19 09:54:23,806 main ERROR Unable to create file /opt/logstash-5.5.0/logs/logstash-slowlog-plain.log java.io.IOException: No such file or directory

    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:403)
    at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:73)
    at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:81)
    at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:103)
    at org.apache.logging.log4j.core.appender.RollingFileAppender.createAppender(RollingFileAppender.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:132)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:918)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:858)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:850)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:479)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:219)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:231)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:496)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:249)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:239)
   
    at opt.logstash_minus_5_dot_5_dot_0.lib.bootstrap.environment.__file__(/opt/logstash-5.5.0/lib/bootstrap/environment.rb:71)
    at opt.logstash_minus_5_dot_5_dot_0.lib.bootstrap.environment.load(/opt/logstash-5.5.0/lib/bootstrap/environment.rb)
    at org.jruby.Ruby.runScript(Ruby.java:857)

Caused by: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@30591043] unable to create manager for [/opt/logstash-5.5.0/logs/logstash-slowlog-plain.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@9c9e9f3[pattern=/opt/logstash-5.5.0/logs/logstash-slowlog-plain-%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=1, max=7), advertiseURI=null, layout=org.apache.logging.log4j.core.layout.JsonLayout@67ab1cbb]]
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:75)
at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:81)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:103)
at org.apache.logging.log4j.core.appender.RollingFileAppender.createAppender(RollingFileAppender.java:191)
... 105 more

2017-07-19 09:54:24,121 main ERROR Null object returned for RollingFile in Appenders.
2017-07-19 09:54:24,122 main ERROR Null object returned for RollingFile in Appenders.
2017-07-19 09:54:24,123 main ERROR Null object returned for RollingFile in Appenders.
2017-07-19 09:54:24,123 main ERROR Null object returned for RollingFile in Appenders.
2017-07-19 09:54:24,124 main ERROR Unable to locate appender "plain_rolling" for logger config "root"
2017-07-19 09:54:24,125 main ERROR Unable to locate appender "plain_rolling_slowlog" for logger config "slowlog"
[2017-07-19T09:54:24,329][INFO ][logstash.pipeline ] Starting pipeline {"id"=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>1000}
[2017-07-19T09:54:24,355][INFO ][logstash.pipeline ] Pipeline main started
The stdin plugin is now waiting for input:
[2017-07-19T09:54:24,403][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
hello_world
in fact the pipeline was created successfully but i don't get the reasons why all these errors appeared !!!! i have to fix them please any help !!!!!

did you run it like
$ sudo bin/logstash -e 'input { stdin { } } output { stdout {} }' ?

Thank you very much ,i tryed and every thing went well
so the problm maintains in the permission ??

Yes, as a user you need to run it using sudo

just one an other question, is it necessary to create a config file for the pipeline in /etc/logstash/conf.d because i installed logstash in /opt/ and did not find logstash directory in /etc/ so does it pose a problem ??

Yes you need to

last day everything worked with sudo , i did not change anything , i am trying now but look an an error appears
sudo bin/logstash -e 'input { stdin { } } output { stdout {} }'
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Sending Logstash's logs to /opt/logstash-5.5.0/logs which is now configured via log4j2.properties
[2017-07-20T11:08:13,997][INFO ][logstash.pipeline ] Starting pipeline {"id"=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>1000}
[2017-07-20T11:08:14,032][INFO ][logstash.pipeline ] Pipeline main started
The stdin plugin is now waiting for input:
[2017-07-20T11:08:14,090][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
hello
2017-07-20T10:08:20.657Z vds005.insightscale.tn hello
^C[2017-07-20T11:08:24,952][WARN ][logstash.runner ] SIGINT received. Shutting down the agent.
[2017-07-20T11:08:24,962][WARN ][logstash.agent ] stopping pipeline {:id=>"main"}

any help please !!!

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