Question

How to configure logstash-forwarder and make it working on AWS linux instances?

  • Posted February 10, 2015

i have configured ELK effectively on AWS linux. however, i am not able to get logstash-forwarder working and getting below error while starting the logstash-forwarder service on client servers which are Amazon linux.

“/etc/init.d/logstash-forwarder: line 25: /lib/init/vars.sh: No such file or directory”

can anyone help me on this.

also suggest how i can check and confirm the functioning of my ELK server.

Thanks in advance.

Shail

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I wrote this init script for RedHat/CentOS:

https://gist.github.com/jarpy/df2c4943e70f88b6076a There’s also a bunch of example init scripts, for various distributions, taken from James Turnbull’s excellent Logstash book:

http://www.logstashbook.com/code/4/

Note that the init script was removed from the logstash-forwarder Github repo in February. This link is to the last version of the init script

https://raw.githubusercontent.com/elastic/logstash-forwarder/a73e1cb7e43c6de97050912b5bb35910c0f8d0da/logstash-forwarder.init

Without knowing more about how you installed logstash-forwarder, it’s hard to give a good answer to your question. You can grab and install the init script in the GitHub repo using:

cd /etc/init.d/; sudo wget https://raw.github.com/elasticsearch/logstash-forwarder/master/logstash-forwarder.init -O logstash-forwarder
sudo chmod +x logstash-forwarder
sudo update-rc.d logstash-forwarder defaults

This assumes your logstash-forwarder binary is installed to /opt/logstash-forwarder/bin/logstash-forwarder Edit the DAEMON variable as needed if that’s not the case.

Checkout this tutorial for all the information on setting up an ELK server on Ubuntu: