How to avoid data duplication in elasticsearch when data send from logstash?

Have a look at this blog post, which covers how to avoid duplicates.