Hmm. I also couldn't get stdout initially. I did a quick test with CentOS Linux release 7.6.1810
& rpm installed logstash 6.7.2
.
logstash.conf
cat /etc/logstash/conf.d/logstash.conf
input {
file {
path => "/tmp/URLTestOutput"
codec => "json"
start_position => "beginning"
}
}
output {
stdout { codec => rubydebug }
}
After I forced systemd StandardOutput=journal
, I could see the output in journalctl.
# /etc/systemd/system/logstash.service.d/override.conf
[Service]
StandardOutput=journal
StandardError=journal
(hint: sudo systemctl edit logstash.service
to add the override listed above, then use sudo systemctl daemon-reload
)
May 23 15:49:41 localhost.localdomain systemd[1]: Started logstash.
May 23 15:49:41 localhost.localdomain logstash[5091]: OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
May 23 15:50:09 localhost.localdomain logstash[5091]: Sending Logstash logs to /var/log/logstash which is now configured via log4j2.properties
May 23 15:50:11 localhost.localdomain logstash[5091]: [2019-05-23T15:50:11,081][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.7.2"}
May 23 15:50:25 localhost.localdomain logstash[5091]: [2019-05-23T15:50:25,685][INFO ][logstash.pipeline ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>1, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
May 23 15:50:27 localhost.localdomain logstash[5091]: [2019-05-23T15:50:27,122][INFO ][logstash.inputs.file ] No sincedb_path set, generating one based on the "path" setting {:sincedb_path=>"/var/lib/logstash/plugins/inputs/file/.sincedb_35b0b3db3268e34aa137a3db09ad6995", :path=>["/tmp/URLTestOutput"]}
May 23 15:50:27 localhost.localdomain logstash[5091]: [2019-05-23T15:50:27,236][INFO ][logstash.pipeline ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x1807ea48 run>"}
May 23 15:50:27 localhost.localdomain logstash[5091]: [2019-05-23T15:50:27,511][INFO ][filewatch.observingtail ] START, creating Discoverer, Watch with file and sincedb collections
May 23 15:50:27 localhost.localdomain logstash[5091]: [2019-05-23T15:50:27,715][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
May 23 15:50:29 localhost.localdomain logstash[5091]: [2019-05-23T15:50:29,088][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
May 23 15:50:29 localhost.localdomain logstash[5091]: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
May 23 15:50:29 localhost.localdomain logstash[5091]: {
May 23 15:50:29 localhost.localdomain logstash[5091]: "@version" => "1",
May 23 15:50:29 localhost.localdomain logstash[5091]: "message" => "the first one",
May 23 15:50:29 localhost.localdomain logstash[5091]: "host" => "localhost.localdomain",
May 23 15:50:29 localhost.localdomain logstash[5091]: "path" => "/tmp/URLTestOutput",
May 23 15:50:29 localhost.localdomain logstash[5091]: "@timestamp" => 2019-05-23T15:50:29.074Z,
May 23 15:50:29 localhost.localdomain logstash[5091]: "foo" => "bar"
May 23 15:50:29 localhost.localdomain logstash[5091]: }
May 23 15:50:29 localhost.localdomain logstash[5091]: {
May 23 15:50:29 localhost.localdomain logstash[5091]: "@version" => "1",
May 23 15:50:29 localhost.localdomain logstash[5091]: "message" => "the second one",
May 23 15:50:29 localhost.localdomain logstash[5091]: "host" => "localhost.localdomain",
May 23 15:50:29 localhost.localdomain logstash[5091]: "path" => "/tmp/URLTestOutput",
May 23 15:50:29 localhost.localdomain logstash[5091]: "@timestamp" => 2019-05-23T15:50:29.223Z,
May 23 15:50:29 localhost.localdomain logstash[5091]: "foo" => "bar2"
May 23 15:50:29 localhost.localdomain logstash[5091]: }