# Duplicate Documents

**URL:** <https://discuss.elastic.co/t/duplicate-documents/295343>\
**Category:** Beats\
**Tags:** functionbeat\
**Created:** [January 25, 2022, 12:12pm UTC](https://discuss.elastic.co/t/duplicate-documents/295343 "2022-01-25T12:12:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![driveirk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/driveirk/32/102253_2.png) [@driveirk](https://discuss.elastic.co/u/driveirk)\
**Post date:** [January 25, 2022, 12:12pm UTC](https://discuss.elastic.co/t/duplicate-documents/295343/1 "2022-01-25T12:12:07Z")

</div>

If there are communication problems, then in some cases the logs come 2 or 3 times, all the logs of one call are duplicated.

Functionbeat config:

```auto
functionbeat:
  provider:
    aws:
      deploy_bucket: functionbeat-deploy
      endpoint: s3.amazonaws.com
      functions:
      - description: lambda function for cloudwatch logs
        enabled: true
        name: elk-shipper
        triggers:
        - log_group_name: /aws/lambda/secure-downloads
        type: cloudwatch_logs
keystore:
  path: /tmp/functionbeat.keystore
output:
  logstash:
    hosts:
    - logstash.net:1999
    pipelining: 0
    ttl: 0
    worker: 1
path:
  config: /etc/functionbeat
  data: /tmp
  home: /etc/functionbeat
  logs: /tmp/logs
processors:
- add_fields:
    fields:
      app_name: lss
      component_type: aws
      hostname: -lambda
      location: aws
      log_format: json
      log_type: shipper
      log_signal: ASDFGH
    target: ""

```

AWS logs:

```auto
2022-01-25T10:15:14.519Z	ERROR	[publisher_pipeline_output]	pipeline/output.go:180	failed to publish events: write tcp 169.254.76.1:52578->1.1.1.1:1999: write: connection reset by peer
2022-01-25T10:15:14.519Z	INFO	[publisher_pipeline_output]	pipeline/output.go:143	Connecting to backoff(tcp://logstash.net:1999)

```

I tried to change ttl and pipelining, but it did not work.  
Logstash logs are empty, no errors.  
I will be glad for any help.

---

<div class="post-metadata">

**Author:** ![driveirk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/driveirk/32/102253_2.png) [@driveirk](https://discuss.elastic.co/u/driveirk)\
**Post date:** [January 25, 2022, 1:18pm UTC](https://discuss.elastic.co/t/duplicate-documents/295343/2 "2022-01-25T13:18:38Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/7/0/70047ba0a1f055fec40e663f90c2c78eefdfe073.png)  
Each burst is a duplicate of the logs.

---

<div class="post-metadata">

**Author:** ![driveirk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/driveirk/32/102253_2.png) [@driveirk](https://discuss.elastic.co/u/driveirk)\
**Post date:** [January 26, 2022, 10:15am UTC](https://discuss.elastic.co/t/duplicate-documents/295343/3 "2022-01-26T10:15:07Z")

</div>

I increased the timeout in the lambda settings, now AWS does not restart lambda and duplicates do not appear.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 23, 2022, 12:15pm UTC](https://discuss.elastic.co/t/duplicate-documents/295343/4 "2022-02-23T12:15:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
