# JSON Parsing Issue

**URL:** <https://discuss.elastic.co/t/json-parsing-issue/265219>\
**Category:** Logstash\
**Created:** [February 23, 2021, 3:41pm UTC](https://discuss.elastic.co/t/json-parsing-issue/265219 "2021-02-23T15:41:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 23, 2021, 4:07pm UTC](https://discuss.elastic.co/t/json-parsing-issue/265219/2 "2021-02-23T16:07:03Z")

</div>

Your [vpn][tunnel\_type] is not a string, it is an object. So your mutate filter does not do anything. Trying to parse this object with a json filter

```
    "tunnel_type" => {
          "tunnel_id" => "1087764505",
        "tunnel_type" => "ssl-tunnel",
          "tunnel_ip" => "192.168.1.1"
    }

```

gets the error message

```auto
 Error parsing json {:source=>"[vpn][tunnel_type]", :raw=>{"tunnel_id"=>"1087764505", "tunnel_ip"=>"192.168.1.1", "tunnel_type"=>"ssl-tunnel"}, :exception=>java.lang.ClassCastException: ...

```

If it were a string then you would get the error

```auto
Error parsing json {:source=>"[vpn][tunnel_type]", :raw=>"{\"tunnel_id\"=>\"1087764505\", \"tunnel_type\"=>\"ssl-tunnel\", \"tunnel_ip\"=>\"192.168.1.1\"}", :exception=>#<LogStash::Json::ParserError: Unexpected character ('=' (code 61)): ...

```

If you need to move the contents of [vpn][tunnel\_type] to the top level use [ruby](https://discuss.elastic.co/t/how-to-dynamically-move-nested-key-value-to-root-level/180006/2).

---

_[View the full topic](https://discuss.elastic.co/t/json-parsing-issue/265219)._
