

test.
filebeat.yml.#======= For Filebeat 7.x or later versions, change `filebeat.prospectors` to `filebeat.inputs` =======filebeat.prospectors:- input_type: log# This is the path to the monitoring file.paths:- /var/log/messages#======= Outputs =========#------------------ kafka -------------------------------------output.kafka:version:0.10.2 // Set the value to the open-source version of the CKafka instance# Set to the access address of the CKafka instancehosts: ["xx.xx.xx.xx:xxxx"]# Set the name of the target topictopic: 'test'partition.round_robin:reachable_only: falserequired_acks: 1compression: nonemax_message_bytes: 1000000# The following parameters need to be configured for SASL. If SASL is not required, skip them.username: "yourinstance#yourusername" // You need to concatenate the instance ID and usernamepassword: "yourpassword"
sudo ./filebeat -e -c filebeat.yml
testlog).echo ckafka1 >> testlogecho ckafka2 >> testlogecho ckafka3 >> testlog
{"@timestamp":"2017-09-29T10:01:27.936Z","beat":{"hostname":"10.193.9.26","name":"10.193.9.26","version":"5.6.2"},"input_type":"log","message":"ckafka1","offset":500,"source":"/data/ryanyyang/hcmq/beats/filebeat-5.6.2-linux-x86_64/testlog","type":"log"}{"@timestamp":"2017-09-29T10:01:30.936Z","beat":{"hostname":"10.193.9.26","name":"10.193.9.26","version":"5.6.2"},"input_type":"log","message":"ckafka2","offset":508,"source":"/data/ryanyyang/hcmq/beats/filebeat-5.6.2-linux-x86_64/testlog","type":"log"}{"@timestamp":"2017-09-29T10:01:33.937Z","beat":{"hostname":"10.193.9.26","name":"10.193.9.26","version":"5.6.2"},"input_type":"log","message":"ckafka3","offset":516,"source":"/data/ryanyyang/hcmq/beats/filebeat-5.6.2-linux-x86_64/testlog","type":"log"}
# The following parameters need to be configured for SASL. If SASL is not required, skip them.username: "yourinstance#yourusername" // You need to concatenate the instance ID and usernamepassword: "yourpassword"
/var/log/filebeat/filebeat) contains a large number of INFO logs as follows:2019-03-20T08:55:02.198+0800 INFO kafka/log.go:53 producer/broker/544 starting up2019-03-20T08:55:02.198+0800 INFO kafka/log.go:53 producer/broker/544 state change to [open] on wp-news-filebeat/42019-03-20T08:55:02.198+0800 INFO kafka/log.go:53 producer/leader/wp-news-filebeat/4 selected broker 5442019-03-20T08:55:02.198+0800 INFO kafka/log.go:53 producer/broker/478 state change to [closing] because EOF2019-03-20T08:55:02.199+0800 INFO kafka/log.go:53 Closed connection to broker bitar1d12:90922019-03-20T08:55:02.199+0800 INFO kafka/log.go:53 producer/leader/wp-news-filebeat/5 state change to [retrying-3]2019-03-20T08:55:02.199+0800 INFO kafka/log.go:53 producer/leader/wp-news-filebeat/4 state change to [flushing-3]2019-03-20T08:55:02.199+0800 INFO kafka/log.go:53 producer/leader/wp-news-filebeat/5 abandoning broker 4782019-03-20T08:55:02.199+0800 INFO kafka/log.go:53 producer/leader/wp-news-filebeat/2 state change to [retrying-2]2019-03-20T08:55:02.199+0800 INFO kafka/log.go:53 producer/leader/wp-news-filebeat/2 abandoning broker 5412019-03-20T08:55:02.199+0800 INFO kafka/log.go:53 producer/leader/wp-news-filebeat/3 state change to [retrying-2]2019-03-20T08:55:02.199+0800 INFO kafka/log.go:53 producer/broker/478 shut down
output.kafka:version:0.10.2 // Set the value to the open-source version of the CKafka instance
compression.codec cannot be set.InValid.フィードバック