背景:过滤ES集群中特定类型的某个时间段的数据到新的ES集群
具体操作下:
###类型TCC
input{
elasticsearch {
hosts => "10.10.x.x:9200"
index => "cqct_20200508_03"
query => '{"query":{"bool":{"must":[{"range":{"optime":{"gt":"1591754706000","lt":"1591754706006"}}}],"must_not":[],"should":[]}},"from":0,"sort":[],"aggs":{}}'
docinfo => true
}
}
filter{
if [@metadata][_type] != "TCC" {
drop{}
}
}
output{
elasticsearch{
hosts => "10.10.y.y:9200"
index => "cqct_20200508_03"
document_type => "TCC"
document_id => "%{id}"
codec => json_lines
}
stdout{
codec => json_lines
}
}
##R