I have installed logstash using RPM. It created sample file in /etc/init/logstash.conf. When I start the process using sudo initctl start logstash, it is creating pid and the service is running in the background. But it does not seem to do anything. Overall, I have two issues now
When the process is running it is not doing anything
Right now (after fine tuning some settings?), it looks like it respawning the process.
Sample log for 2nd issue, from /var/log/messages
Feb 13 11:24:45 myhost init: logstash main process (5944) terminated with status 1
Feb 13 11:24:45 myhost init: logstash main process ended, respawning
Feb 13 11:25:05 myhost init: logstash main process (6010) terminated with status 1
Feb 13 11:25:05 myhost init: logstash main process ended, respawning
As far as issue-1 is concerned, I am not seeing any updates under the logstash logs folder (/var/log/logstash/)
When i run the command using command line then it is ingesting the data (doing some action at least). /usr/share/logstash/bin/logstash -f /usr/share/logstash/config/conf.d
These are my settings:
under /etc/default/logstash
I have placed two .conf files under /usr/share/logstash/config/conf.d
Please help me as how to configure the logstash service which can refer to some *.conf files which will contain specific inputs,filters & outputs. The reason I want logstash to run as service is that there will be updates to the files being monitored (i.e. which we are interested to ingest data).
If you set variables in /etc/default/logstash then that script is sourced by /usr/share/logstash/bin/logstash, but they are not exported, so logstash itself never sees them. You need to export the variables.
ah, I also noticed just now. It displayed permission issue for logstash-plain.log. Fixed permission problem and now it is able to write and following is written in /var/log/logstash/logstash-plain.log
[2018-02-13T14:42:59,769][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<NameError: undefined local variable or method `dotfile' for #<AwesomePrint::Inspector:0x484eb628>
Did you mean? @@dotfile>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:163:in `merge_custom_defaults!'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:50:in `initialize'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/awesome_print-1.8.0/lib/awesome_print/core_ext/kernel.rb:9:in `ai'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-codec-rubydebug-3.0.5/lib/logstash/codecs/rubydebug.rb:39:in `encode_default'", "org/jruby/RubyMethod.java:115:in `call'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-codec-rubydebug-3.0.5/lib/logstash/codecs/rubydebug.rb:35:in `encode'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/base.rb:50:in `block in multi_encode'", "org/jruby/RubyArray.java:1734:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/base.rb:50:in `multi_encode'", "/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:90:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/single.rb:15:in `block in multi_receive'", "org/jruby/ext/thread/Mutex.java:148:in `synchronize'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/single.rb:14:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:50:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:487:in `block in output_batch'", "org/jruby/RubyHash.java:1343:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:486:in `output_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:438:in `worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:393:in `block in start_workers'"]}
Thanks @Badger, I think i will look into those issues. But, is there any downside of commenting this line out? #stdout { codec => rubydebug }. Is it just used to display the parsed data in the local machine?
Yes, the rubydebug codec formats stdout for the logstash process. That is very useful for seeing how your messages are being parsed whilst debugging your configuration. I generally use an output like that while testing my filters. I don't send anything to elasticsearch until I know the filters are doing what I want.
Exactly. When I was testing also, I did not see any issues. The only difference was that i was using command line and option -f. So I did not feel that anything was wrong with rubydebug. Anyways, thanks for your time and help
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.