請你幫忙寫一個腳本來ES另外,運行此腳本複製索引數據使用logstash
input {
# We read from the "old" cluster
elasticsearch {
hosts => [ "localhost" ]
port => "9200"
index => "products"
size => 500
scroll => "5m"
docinfo => true
}
}
output {
# We write to the "new" cluster
elasticsearch {
host => "localhost"
port => "9200"
protocol => "http"
index => "%{[@metadata][_index1]}"
index_type => "%{[@metadata][_type1]}"
document_id => "%{[@metadata][_id]}"
}
# We print dots to see it in action
stdout {
codec => "dots"
}
}
,而X收到以下錯誤這是我logstash.conf文件當我運行這個m到處以下錯誤
未知設置「端口」的elasticsearch
{:level=>:error}
fetched an invalid config {:config=>"input {\n # We read from the \"old\" cluster\n elasticsearch {\n hosts => [ \"localhost\" ]\n port => \"9200\"\n index => \"products\"\n size => 500\n scroll => \"5m\"\n docinfo => true\n }\n}\n\noutput {\n # We write to the \"new\" cluster\n elasticsearch {\n host => \"localhost\"\n port => \"9200\"\n protocol => \"http\"\n index => \"%{[@metadata][_index1]}\"\n index_type => \"%{[@metadata][_type1]}\"\n document_id => \"%{[@metadata][_id]}\"\n }\n # We print dots to see it in action\n stdout {\n codec => \"dots\"\n }\
如果您使用Logstash 2+,港口和INDEX_TYPE選項不再有效 – baudsp
是我使用的日誌藏匿就是現在應該做的2.X版本。 –
您能否讓我知道2.X版本的正確格式? –