# Present end of nested field as a part of value

**URL:** <https://discuss.elastic.co/t/present-end-of-nested-field-as-a-part-of-value/363643>\
**Category:** Elasticsearch\
**Created:** [July 23, 2024, 3:00pm UTC](https://discuss.elastic.co/t/present-end-of-nested-field-as-a-part-of-value/363643 "2024-07-23T15:00:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddoroshenko](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@ddoroshenko](https://discuss.elastic.co/u/ddoroshenko)\
**Post date:** [July 23, 2024, 3:00pm UTC](https://discuss.elastic.co/t/present-end-of-nested-field-as-a-part-of-value/363643/1 "2024-07-23T15:00:16Z")

</div>

Hi,

I have records which could contain nested fields with a high depth.  
And I want to convert part of the nested field to the part of the value.

What I have before

```auto
{
  "a":{
    "b":{
      "c":{
        "d":{
          "e":{
            "f":"some value"
          }
        }
      }
    }
  }
}

```

What I want as a result

```auto
{
  "a":{
    "b":{
      "c":"d.e.f:some value"
    }
  }
}

```

Is it possible to do?

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [July 23, 2024, 4:38pm UTC](https://discuss.elastic.co/t/present-end-of-nested-field-as-a-part-of-value/363643/2 "2024-07-23T16:38:33Z")

</div>

Hi @ddoroshenko

I don't think that's possible.

---

<div class="post-metadata">

**Author:** ![ddoroshenko](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@ddoroshenko](https://discuss.elastic.co/u/ddoroshenko)\
**Post date:** [July 23, 2024, 4:54pm UTC](https://discuss.elastic.co/t/present-end-of-nested-field-as-a-part-of-value/363643/3 "2024-07-23T16:54:31Z")

</div>

@RabBit_BR after little research I've found that I can do it with json\_encode Logstash filter

It will look like a json formatted string

```auto
{
  "a":{
    "b":{
      "c":"{\"d\":{\"e\":{\"f\":\"some value\"}}}"
    }
  }
}

```
