# Remove duplicate field value

**URL:** <https://discuss.elastic.co/t/remove-duplicate-field-value/107125>\
**Category:** Logstash\
**Created:** [November 10, 2017, 3:55am UTC](https://discuss.elastic.co/t/remove-duplicate-field-value/107125 "2017-11-10T03:55:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 10, 2017, 3:55am UTC](https://discuss.elastic.co/t/remove-duplicate-field-value/107125/1 "2017-11-10T03:55:06Z")

</div>

In my logstash output I received following output.

```
"log_name" => [
    [0] "Authentication",
    [1] "Authentication"
],
               "log_level" => "info",
              "session_id" => [
    [0] "4280340685",
    [1] "4280340685"
],
            "header_flags" => [
    [0] "Encrypted",
    [1] "Encrypted"
],

```

In that output, for filed name **log\_name** , **session\_id** and **header\_flags** have duplicate filed values.

How do I remove those duplicate field value under logstash filter, **without using KV**

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 10, 2017, 7:10am UTC](https://discuss.elastic.co/t/remove-duplicate-field-value/107125/2 "2017-11-10T07:10:11Z")

</div>

What does your config look like? Do you be any chance have multiple grok patterns that can match the same event and therefore extract the same field twice?

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [November 10, 2017, 9:09am UTC](https://discuss.elastic.co/t/remove-duplicate-field-value/107125/3 "2017-11-10T09:09:13Z")

</div>

Yes,

First message match a grok pattern and then followed by KV pair

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 10, 2017, 9:14am UTC](https://discuss.elastic.co/t/remove-duplicate-field-value/107125/4 "2017-11-10T09:14:13Z")

</div>

Can you show the config and a sample raw message?

---

<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 8, 2017, 9:14am UTC](https://discuss.elastic.co/t/remove-duplicate-field-value/107125/5 "2017-12-08T09:14:16Z")

</div>

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