I have been using logstash for the past two years and consider myself to be fairly familiar with configurations. Actually this configuration worked before and just stopped working a few days ago.
To make a minimal case, I downloaded the latest logstash 5.5.2, and start new with this config:
input {
kafka {
topics => ["test_kafka_logstash_2"]
bootstrap_servers => "192.168.0.112:9092"
id => "test_kafka_input"
auto_offset_reset => "latest"
}
stdin {
id => "test_stdin"
}
}
filter {
mutate {
add_field => { "hello" => "world" }
}
}
output {
stdout { codec => rubydebug }
kafka {
codec => plain {
format => "%{message}"
}
topic_id => "test_logstash_kafka_output"
bootstrap_servers => "192.168.0.112:9092"
id => "test_kafka_output"
}
}
Run it with this command:
Then enter two lines:
And the proof that the two lines were written to the output kafka topic successfully
Exactly two lines are written to the output topic.
Now for the kafka input, I have script that writes to the test_kafka_logstash_2
topic and this is total count of messages after the test:
Below is the complete log that is logged:
logstashtest.log
JAVA_OPTS was set to [ -Xmx1g -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="E:\logstash-5.3.0/heapdump.hprof"]. Logstash will trust these options, and not set any defaults that it might usually set
Sending Logstash's logs to E:/logstash-5.5.2/logs which is now configured via log4j2.properties
[2017-08-24T20:45:59,912][DEBUG][logstash.plugins.registry] Adding plugin to the registry {:name=>"fb_apache", :type=>:modules, :class=>#<LogStash::Modules::Scaffold:0x7e4404bd @module_name="fb_apache", @directory="E:/logstash-5.5.2/modules/fb_apache/configuration">}
[2017-08-24T20:45:59,943][DEBUG][logstash.runner ] -------- Logstash Settings (* means modified) ---------
[2017-08-24T20:45:59,943][DEBUG][logstash.runner ] node.name: "USER-TQRCC4IDBG"
[2017-08-24T20:45:59,943][DEBUG][logstash.runner ] *path.config: "logstash_test.conf"
[2017-08-24T20:45:59,943][DEBUG][logstash.runner ] path.data: "E:/logstash-5.5.2/data"
[2017-08-24T20:45:59,943][DEBUG][logstash.runner ] modules.cli: []
[2017-08-24T20:45:59,943][DEBUG][logstash.runner ] modules: []
[2017-08-24T20:45:59,943][DEBUG][logstash.runner ] config.test_and_exit: false
This file has been truncated. show original
system
(system)
Closed
September 21, 2017, 12:52pm
2
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.