I'm experiencing a similar problem in Ubuntu 16.04. Logstash works just fine when I run it manually from bin/logstash and specify the config file, but doesn't fully launch when I run it as a service.
#My configuration file under, /etc/logstash/conf.d/central.conf:
input {
tcp {
port => 5000
type => syslog
}
udp {
port => 5000
type => syslog
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:[%{POSINT:syslog_pid}])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
output {
elasticsearch { hosts => ["10.13.1.68:9200"] }
stdout { codec => rubydebug }
}
#Here are the folder permissions:
~# ls -lsh /etc/logstash/
total 28K
4.0K drwxrwxr-x 2 root root 4.0K Nov 29 22:58 conf.d
4.0K -rw-rw-r-- 1 root root 1.7K Nov 24 10:22 jvm.options
4.0K -rw-rw-r-- 1 root root 1.4K Nov 24 10:22 log4j2.properties
4.0K -rw-rw-r-- 1 logstash logstash 710 Nov 29 22:23 logstash.yml
4.0K -rw-rw-r-- 1 root root 1.7K Nov 24 10:22 startup.options
#And the configuration file permissions:
~# ls -lsh /etc/logstash/conf.d/
total 4.0K
4.0K -rw-rw-r-- 1 logstash logstash 1.2K Nov 29 21:31 central.conf
#Debug log output from /var/log/logstash/logstash-plain.log when starting logstash as a service:
tail: cannot open '100' for reading: No such file or directory
==> /var/log/logstash/logstash-plain.log <==
[2016-11-30T16:01:00,717][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@resurrect_delay = 5
[2016-11-30T16:01:00,717][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@validate_after_inactivity = 10000
[2016-11-30T16:01:00,724][DEBUG][logstash.codecs.rubydebug] config LogStash::Codecs::RubyDebug/@id = "rubydebug_5b0911ca-81d2-45ac-b7e7-9d532c4cd66e"
[2016-11-30T16:01:00,724][DEBUG][logstash.codecs.rubydebug] config LogStash::Codecs::RubyDebug/@enable_metric = true
[2016-11-30T16:01:00,724][DEBUG][logstash.codecs.rubydebug] config LogStash::Codecs::RubyDebug/@metadata = false
[2016-11-30T16:01:00,761][DEBUG][logstash.outputs.stdout ] config LogStash::Outputs::Stdout/@codec = <LogStash::Codecs::RubyDebug id=>"rubydebug_5b0911ca-81d2-45ac-b7e7-9d532c4cd66e", enable_metric=>true, metadata=>false>
[2016-11-30T16:01:00,761][DEBUG][logstash.outputs.stdout ] config LogStash::Outputs::Stdout/@id = "52afc8ad01e565bac68d42f46ca7fefa6a9fb53a-7"
[2016-11-30T16:01:00,761][DEBUG][logstash.outputs.stdout ] config LogStash::Outputs::Stdout/@enable_metric = true
[2016-11-30T16:01:00,761][DEBUG][logstash.outputs.stdout ] config LogStash::Outputs::Stdout/@workers = 1
[2016-11-30T16:01:00,762][INFO ][logstash.runner ] Using config.test_and_exit mode. Config Validation Result: OK. Exiting Logstash
Also just to note, I have UFW and AppArmor disabled (didn't seem to make a difference either way).