I have following setup:
FileBeat -> Logstash -> Elasticsearch -> Kibana (all 5.1.1)
When I push the log file (JSON
) into Filebeat, and If I try to see it in Kibana Interface, the same logs are added 3-4 time (duplicates).
After checking the FileBeat logs I came to know that it may be because Filebeat does not receive an acknowledgement for sent logs and so it keeps on resending.
to stop receiving duplicate documents I think I will have to use a document_id
in logstash config file.
i.e.
output
{
elasticsearch {
document_id => "%{offset}"
index => "ap-index"
hosts => ["localhost:9222"]
}
}
My question is, Is the offset field unique for each document? and Is that a correct way to stop receiving duplicates?