###类型ZB
input{
elasticsearch {
hosts => "10.10.x.x:9200"
index => "index"
query => '{"query":{"bool":{"must":[{"range":{"optime":{"gt":"1","lt":"100"}}}],"must_not":[],"should":[]}},"from":0,"sort":[],"aggs":{}}'
docinfo => true
}
}
filter{
if [@metadata][_type] != "ZB" {
drop{}
}
}
output{
elasticsearch{
hosts => "10.10.0.0:9200"
index => "index2"
#document_type => "ZB"
document_id => "%{id}"
codec => json_lines
}
stdout{
codec => json_lines
}
}
##RFID
input{
elasticsearch {
hosts => "10.10.x.x:9200"
index => "index_*"
query => '{"query":{"bool":{"must":[{"range":{"collectTime":{"gt":"1","lt":"200"}}}],"must_not":[],"should":[]}},"from":0,"sort":[],"aggs":{}}'
docinfo => true
}
}
filter{
if [@metadata][_type] != "RFID" {
drop{}
}
}
output{
elasticsearch{
hosts => "10.10.X.0:9200"
index => "index_new"
#document_type => "RFID"
document_id => "%{id}"
codec => json_lines
}
stdout{
codec => json_lines
}
}
网友评论