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

Posted February 10, 2015 7k views

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/ 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.


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.

Submit an Answer
3 answers

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 -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:

by Mitchell Anicas
In this tutorial, we will go over the installation of Logstash 1.4.2 and Kibana 3, and how to configure them to gather and visualize the syslogs of our systems in a centralized location. Logstash is an open source tool for collecting, parsing, and storing logs for future use. Kibana 3 is a web interface that can be used to search and view the logs that Logstash has indexed. Elasticsearch, Logstash, and Kibana, when used together is known as an ELK stack.

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

I wrote this init script for RedHat/CentOS:

There’s also a bunch of example init scripts, for various distributions, taken from James Turnbull’s excellent Logstash book: