这是我在Logstash的.config
文件中输出的内容:
output {
elasticsearch {
document_type => "apache"
}}
当输出设置为stdout {}
时,它的效果非常好。
我让Elasticsearch在本地运行,没有任何问题。
当我运行命令时:
sudo ./logstash -f sample_1.conf --debug
Logstash只是挂起。
这是我使用--debug
:
[DEBUG] 2018-03-04 03:28:56.245 [pool-2-thread-2] jvm - collector name {:name=>"ParNew"}
[DEBUG] 2018-03-04 03:28:56.255 [pool-2-thread-2] jvm - collector name {:name=>"ConcurrentMarkSweep"}
[DEBUG] 2018-03-04 03:28:58.448 [[main]<file] file - _globbed_files: /usr/share/logstash/bin/log_file.txt: glob is: ["/usr/share/logstash/bin/log_file.txt"]
[DEBUG] 2018-03-04 03:28:59.353 [Ruby-0-Thread-12: /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:617] pipeline - Pushing flush onto pipeline {:pipeline_id=>"main", :thread=>"#<Thread:0x34284e61@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:246 sleep>"}
[DEBUG] 2018-03-04 03:29:01.268 [pool-2-thread-2] jvm - collector name {:name=>"ParNew"}
[DEBUG] 2018-03-04 03:29:01.268 [pool-2-thread-2] jvm - collector name {:name=>"ConcurrentMarkSweep"}
[DEBUG] 2018-03-04 03:29:04.354 [Ruby-0-Thread-12: /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:617] pipeline - Pushing flush onto pipeline {:pipeline_id=>"main", :thread=>"#<Thread:0x34284e61@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:246 sleep>"}
这些线条无限期地一次又一次地重复。 Logstash和Elasticsearch版本均为6.2.2
可能是什么问题?
答案 0 :(得分:1)
从版本6.0开始,ElasticSearch删除了文档类型或映射类型。您可以删除document_type,然后重试。
有关详细信息,请参阅https://www.elastic.co/guide/en/elasticsearch/reference/6.0/removal-of-types.html。