Hi , I have a json message log like:
{ 'date': "xx" , 'env': "xx" }
I want to create those fields in elasticsearch just if those fields are present and anything else , my filter is:
filter {
json { source =>"message"
target => "log" }
}
output {
elasticsearch {
hosts => ["x.x.x.x:9200"]
manage_template => false
index => "docker-%{+YYYY.MM.dd}"
}
}
that works but i want to drop the messages that don't satisfy the condition that have only 2 fields in the json log , in this case "date" and "env" , how can I do that?
thanks in advance.