# How to avoid sending duplicated log data to Redis

**URL:** <https://discuss.elastic.co/t/how-to-avoid-sending-duplicated-log-data-to-redis/156831>\
**Category:** Beats\
**Created:** [November 15, 2018, 10:02am UTC](https://discuss.elastic.co/t/how-to-avoid-sending-duplicated-log-data-to-redis/156831 "2018-11-15T10:02:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jin1129](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jin1129/32/37454_2.png) [@Jin1129](https://discuss.elastic.co/u/Jin1129)\
**Post date:** [November 15, 2018, 10:02am UTC](https://discuss.elastic.co/t/how-to-avoid-sending-duplicated-log-data-to-redis/156831/1 "2018-11-15T10:02:41Z")

</div>

My filebeat version is 6.4.2  
as I just mentioned, I want to avoid sending duplicated data to my Redis.  
Assume I have a json file and it contains single json data as follow

```auto
{ "create" : { "_index" : "movies", "_type" : "movie", "_id" : "135569" } }

{ "id": "135569", "title" : "Star Trek Beyond", "year":2016 , "genre":["Action", "Adventure", "Sci-Fi"] }

```

after log file creation, I ran the filebeat and data is stored to my Redis without any issue.  
and then, I inserted extra single json data to my log file and the log file has two json data as follow

```auto
{ "create" : { "_index" : "movies", "_type" : "movie", "_id" : "135569" } }

{ "id": "135569", "title" : "Star Trek Beyond", "year":2016 , "genre":["Action", "Adventure", "Sci-Fi"] },

{ "create" : { "_index" : "movies", "_type" : "movie", "_id" : "122886" } }

{ "id": "122886", "title" : "Star Wars: Episode VII - The Force Awakens", "year":2015 , "genre":["Action", "Adventure", "Fantasy", "Sci-Fi", "IMAX"] }

```

when the log file is saved, my filebeat excuted automatically and Redis has 3 data with duplicated value for \_id 135569.

How can I avoid sending duplicated data to Redis?

Here is my filebeat.yml, it does not have any special option yet.

```auto
#=========================== Filebeat inputs =============================

filebeat.inputs:

- type: log
  enabled: true
  paths:
    - /Users//json_files/Log/*.log

...
...
#-------------------Redis Output ----------
output.redis:
   hosts: ["localhost"]
   key: "filebeat_test_log"
   db: 0
   timeout: 5

```

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [November 15, 2018, 4:00pm UTC](https://discuss.elastic.co/t/how-to-avoid-sending-duplicated-log-data-to-redis/156831/2 "2018-11-15T16:00:58Z")

</div>

This sounds like you edit add additional lines in your editor. Filebeat keeps track of file identity by inode. Editors often do not edit files on disk, but they create a new file and replace the old file with the new file. Filebeat detects it is a new file and sends it again.

---

<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:** [December 13, 2018, 6:01pm UTC](https://discuss.elastic.co/t/how-to-avoid-sending-duplicated-log-data-to-redis/156831/3 "2018-12-13T18:01:11Z")

</div>

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