I have the following logstash.config file:
input {
file {
path => "/home/username/log-stream-test.log"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
output {
file {
path => "/tmp/log-stream-output.log"
}
}
I can run logstash forcing config file (it will create output file /tmp/log-stream-output.log): /opt/bin/logstash -f /etc/logstash/conf.d/logstash.config
But when I try to run logstash as service (sudo service logstash start) it doesn't work (no output file is created). When I tail /var/log/logstash/ (with --debug option active) I get some messages like:
{:timestamp=>"2016-09-27T19:05:03.898000+0000", :message=>"Reading config file", :config_file=>"/etc/logstash/conf.d/logstash.config", :level=>:debug, :file=>"logstash/config/loader.rb", :line=>"69", :method=>"local_config"}
{:timestamp=>"2016-09-27T19:05:04.026000+0000", :message=>"Plugin not defined in namespace, checking for plugin file", :type=>"input", :name=>"file", :path=>"logstash/inputs/file", :level=>:debug, :file=>"logstash/plugin.rb", :line=>"86", :method=>"lookup"}
Am I missing something? How can I run logstash as service with this config file?