12

I have installed logstash as a service using the logstash APT repository on Ubuntu 13.10.

So now I can run:

dpkg -s logstash

And it outputs:

Package: logstash
Status: install ok installed
Priority: extra
Section: default
Installed-Size: 93362
Maintainer: <jls@ds4172>
Architecture: all
Version: 1.4.0-1-c82dc09
Depends: java7-runtime-headless | java6-runtime-headless | j2re1.7
Conffiles:
 /etc/default/logstash 399f19c4d762840a36f6bc056c3739b8
 /etc/default/logstash-web d94db9f8dc1d4ced449175a96e8df09d
 /etc/logrotate.d/logstash 9bb11b4b058868bb41c658c9c3152a83
Description: An extensible logging pipeline
License: Apache 2.0
Vendor: Elasticsearch
Homepage: http://logstash.net

So I see that the logstash service was successfully installed.

I know that running logstash (not as a service) I can specify a configuration like so:

bin/logstash -f /path/to/config-file

But how would I specify a specific configuration when I am running logstash as a service?

closed as off-topic by dawud, mdpc, Ward, Jenny D, Falcon Momot Apr 20 '14 at 20:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – dawud, Ward, Jenny D, Falcon Momot
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I am also looking for same solution. Did you find any answers for running specific config file as service – Mangoski Feb 2 '18 at 18:07
5

you got configuration of logstash in directory /etc/logstash/conf.d/

You got all paths in /etc/init.d/logstash

# logstash configuration directory CONF_DIR=/etc/logstash/conf.d

I got there file /etc/logstash/conf.d/logstash.conf which is automaticlly generated by puppet logstash module :)

  • What is puppet logstash module? Can you provide a link? – Binyomin Trager Apr 18 '14 at 14:17
  • Puppet is a tool to manage infrastructure as code. This module provide easy way to install and configure logstash in puppet managed environment. forge.puppetlabs.com/elasticsearch/logstash – 3h4x Apr 18 '14 at 15:29
1

You need to tell it to start:

sudo service logstash start

And it will use the default config file which is at location /etc/logstash/conf.d.
Like any other service ever.

If you want to use another configuration file you'll need to check in the init script if it's possible to do that.
Very likely it's not and you'd need to copy the init script and change it to use another config file.

  • Just for the record, I am aware that I need to start it. But the part about the default config file is what I am looking for. Thank you. But I believe @ochach got the proper directory. – Binyomin Trager Apr 18 '14 at 14:15
  • @BinyominTrager OK, then I misunderstood that. Normally when you want to show that a package is correctly installed you'd post the output of dpkg -s $package or /usr/bin/$binary --version – faker Apr 18 '14 at 14:18
  • Oh ok, thanks, I will fix the question to make it clearer. – Binyomin Trager Apr 18 '14 at 14:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.