次のようなログスタッシュ構成があります。
input {
file {
path => ["/home/csdata/*.data"]
codec => json {
}
start_position => "beginning"
discover_interval => 5
}
}
output{
if [_up] == 1 {
elasticsearch {
protocol => "http"
host => "[myelasticsearchip]"
cluster => "clustername"
flush_size => 50
index => "%{_index}"
action => "update"
document_id => "%{_id}"
index_type => "%{_type}"
}
}
else if [_id] != "" {
elasticsearch {
protocol => "http"
host => "[myelasticsearchip]"
cluster => "clustername"
flush_size => 50
index => "%{_index}"
document_id => "%{_id}"
index_type => "%{_type}"
}
}
else{
elasticsearch {
protocol => "http"
host => "[myelasticsearchip]"
cluster => "clustername"
index => "%{_index}"
flush_size => 50
index_type => "%{_type}"
}
}
}
私はのトンを持っています
failed action with response of 404, dropping action:
データはすべて同じファイルに順番に入っている必要があるため、更新する前に作成する必要があります。これはすべてのアイテムで発生するわけではありませんが、十分に発生します。これらのエラーは発生しないと思います。
これは、flush_sizes が異なるためですか? アイテムは元のファイルで順番に並んでいますが、INSERT は常に UPDATE の前に来ることを意味します。
どんなアイデアでも大歓迎です!