Elasticsearch: Duplicate Documents

Hi everyone,

I have an occasional problem that sometimes there are several duplicate documents generated.

This is part of our CI and it should upload data to elastic with details about our build failure.

After analysis, i found out it's done in a bash script invoked by ansible and that this curl command is responsible for the upload of Elasticsearch data:

http_result=$(curl --netrc \
              --retry 3 \
              --max-time 60 \
              --speed-time 10 --speed-limit 50 \
              --connect-timeout 5 \
              --write-out "%{response_code}" \
              --output "/dev/null" \
              --silent \
              --show-error \
              --request POST \
              -H "Content-Type: application/json; charset=utf-8" \
              --data-binary @"${file_path}" \
              "{{ mon_url }}${index}/${path}")

However after debugging the bash script i couldn't find multiple uploads attempts.
Is there anything wrong with this curl command?
Is there anyway i can debug this in elastic?

I'm currently using Elasticsearch 7.10.1

Thanks

Are you storing the results of the request being made?