# Logstash Nested JSON Parsing and Transforming data

**URL:** <https://discuss.elastic.co/t/logstash-nested-json-parsing-and-transforming-data/289255>\
**Category:** Logstash\
**Created:** [November 16, 2021, 4:03am UTC](https://discuss.elastic.co/t/logstash-nested-json-parsing-and-transforming-data/289255 "2021-11-16T04:03:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zx8086](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zx8086/32/94917_2.png) [@zx8086](https://discuss.elastic.co/u/zx8086)\
**Post date:** [November 16, 2021, 4:03am UTC](https://discuss.elastic.co/t/logstash-nested-json-parsing-and-transforming-data/289255/1 "2021-11-16T04:03:23Z")

</div>

How would I using the json filter to split the following json document and target / modify the time stamp (event.ts) ?

`{"peer":"EC2LEBOQ77XSF46QEKYYYNKBTVATU33K","agent_name":"test-device","event":{"ts":1637034155000,"t":5,"src":"resilio_share","e":"Downloaded randfile16113","data":{"hash":"E012015B6E31A7077BEE076A3ECB895604F9B73F","name":"randfile16113","path":"randfile16113","size":1048576,"state":"Downloaded"},"id":26179,"jobRunId":11}}`

```auto

filter
{
  json
    {
      source => "message"
    }
}

```

This is as far as I get, as I cannot transform the split json elements

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [November 16, 2021, 4:18am UTC](https://discuss.elastic.co/t/logstash-nested-json-parsing-and-transforming-data/289255/2 "2021-11-16T04:18:28Z")

</div>

What do you mean by split? It is not clear what you are trying to do, can you give more details?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 16, 2021, 5:18am UTC](https://discuss.elastic.co/t/logstash-nested-json-parsing-and-transforming-data/289255/3 "2021-11-16T05:18:58Z")

</div>

It sounds like you want

```
date { match => ["[event][ts]", "UNIX_MS" ] }

```

which will set the @timestamp field of the event.

logstash does not use the . notation of Elasticsearch and kibana to reference fields inside of fields. It has its own (less ambiguous) notation using [and]

---

<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 14, 2021, 5:19am UTC](https://discuss.elastic.co/t/logstash-nested-json-parsing-and-transforming-data/289255/4 "2021-12-14T05:19:01Z")

</div>

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