Keshav Agarwal
Keshav Agarwal

Reputation: 821

Logstash not running

I've a logstash instance, version 2.3.1 which isn't running using the command

sudo service logstash start

Whenever I run this command, it returns logstash started and after a few moments when I check the status, I find that logstash isn't running. Although, when I start the logstash from opt to get output on the terminal, it runs without any error.

Note that logstash.err and logstash.stdout files are empty and logstash.log file isn't anywhere to be found. I've also set LS_GROUP to adm in init.d which caused the same issue on another instance, but even that doesn't seem to work now. Any help would be appreciated!

Upvotes: 1

Views: 9734

Answers (3)

Keshav Agarwal
Keshav Agarwal

Reputation: 821

On an Ubuntu system, this behavior can be seen by logstash. To get around it, you can change the logstash user group in /etc/init.d/logstash to adm which stands for admin and you're good to go.

Upvotes: 2

M.Chen
M.Chen

Reputation: 66

Actually,you should read the guide of logstash.In the "getting started section",The official documentation has the corret way for you to start a logstash work. First,you should write a configure file such as "std.conf",look like this:

input {
  stdin {
  }
}
output{
  stdout{
  codec=>rubydebug
  }
}

Then,start your logstash:

bin/logstash -f conf/std.conf 

If you want this work can run in the background(such as get some log files into elasticsearch),you may also need add "&" in the end of the command,like this:

bin/logstash -f conf/getlog.conf &

with this file(std.conf) and this command,your logstash will start up and if you type any word in you terminal,it will print out in the terminal,like this:

{
   "message" => "hello",
  "@version" => "1",
"@timestamp" => "2016-08-06T19:47:36.543Z",
      "host" => "bag"
}

Now,you have got the normal operation of logstah,you may need more information,from there:The official documentation of logstash

Try this,and keep going,it`s easy for you~

Upvotes: 0

Jeroen Vandevelde
Jeroen Vandevelde

Reputation: 456

This is normal behaviour of Logstash. Can you test if your Logstash instance is working correctly?

Windows: Go to your bin folder of logstash and type logstash

Linux: Enter this command in the prompt (bin folder of your logstash instance) /opt/logstash/bin/logstash

Both: If you get No command given ... you're logstash instance has the correct setup.

You can always run your Logstash instance with this command

logstash -e 'input { stdin { } } output { stdout {} }'

After this you can enter some text values and they will output to your console.

If this all works you can be sure that your Logstash instance is running correctly.

You may ask yourself why is this? This is because Logstash waits to start untill it gets a config to run with or another option.

If you want to start Logstash automatically on startup. You need to use this command.

sudo update-rc.d logstash defaults 96 9

Upvotes: 0

Related Questions