1. 程式人生 > >解決 Reason: The setting `flush_size` in plugin `elasticsearch` is obsolete and is no longer available

解決 Reason: The setting `flush_size` in plugin `elasticsearch` is obsolete and is no longer available

[[email protected] logstash-6.4.2]# ./bin/logstash -f etc/logstash_indexer.conf  -t

Sending Logstash logs to /usr/local/logstash-6.4.2/logs which is now configured via log4j2.properties
[2018-10-25T17:05:46,647][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-10-25T17:05:49,572][FATAL][logstash.runner          ] The given configuration is invalid. Reason: The setting `flush_size` in plugin `elasticsearch` is obsolete and is no longer available. This setting is no longer available as we now try to restrict bulk requests to sane sizes. See the 'Batch Sizes' section of the docs. If you think you still need to restrict payloads based on the number, not size, of events, please open a ticket. If you have any questions about this, you are invited to visit https://discuss.elastic.co/c/logstash and ask.
[2018-10-25T17:05:49,591][ERROR][org.logstash.Logstash    ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

輸出到elasticsearch有些引數不支援了,需要註釋flush_size,否則會報錯The setting flush_size in plugin elasticsearch is obsolete and is no longer available. This setting is no longer available as we now try to restrict bulk requests to sane sizes. See the ‘Batch Sizes’ section of the docs.

input {
        redis {
                host => "192.168.133.130"
                data_type => "list"
                port => "6379"
                key => "logstash:redis"
                type => "redis-input"
        }
}

output {
    elasticsearch {
        hosts => ["192.168.133.128:9200"]
        index => "logstash-%{type}-%{+YYYY.MM.dd}"
        document_type => "%{type}"
#        flush_size => 20000
#        idle_flush_time => 10
        sniffing => true
        template_overwrite => true
    }
}