# Parsing json nested in json from log firehose

**URL:** <https://discuss.elastic.co/t/parsing-json-nested-in-json-from-log-firehose/223593>\
**Category:** Logstash\
**Created:** [March 13, 2020, 11:49pm UTC](https://discuss.elastic.co/t/parsing-json-nested-in-json-from-log-firehose/223593 "2020-03-13T23:49:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drob/32/64446_2.png) [@Drob](https://discuss.elastic.co/u/Drob)\
**Post date:** [March 13, 2020, 11:49pm UTC](https://discuss.elastic.co/t/parsing-json-nested-in-json-from-log-firehose/223593/1 "2020-03-13T23:49:19Z")

</div>

Example Log:

```
<6> 2020-03-13T21:20:46Z aea1b92e-07fe-4e21-7684-7f94 doppler[17]: 
{"cf_app_id":"174545fd-aee6-4d7c-819c-6c94cdf3b68c",
"cf_app_name":"cobra-inbound-read-api",
"cf_org_id":"eb84d2e9-e049-45c3-9a08-a776662be11c",
"cf_org_name":"test-dev-cobra",
"cf_origin":"firehose",
"cf_space_id":"ad85c9b9-bd6f-4db3-9e10-35320da40f01",
"cf_space_name":"inbound",
"deployment":
"cf-434dec3ada8db15170a4",
"event_type":"LogMessage",
"ip":"00.31.56.91",
"job":"diego_cell",
"job_index":"e2b76e28-450a-46b8-816f-f4d642bfcdb9",
"level":"info",
"message_type":"OUT",
"msg":" {\"platform_name\":\"Cobra\",\"application_name\":\"Inbound\",\"service\":\"ReadAPI\",\"message\":\"Updated KeyManager for /etc/cf-instance-credentials/instance.key and /etc/cf-instance-credentials/instance.crt\",\"line_number\":143,\"class\":\"org.cloudfoundry.security.FileWatchingX509ExtendedKeyManager$FileWatcherCallback\",\"@version\":1,\"source_host\":\"a36e2997-c6de-423c-753a-51ec\",\"thread_name\":\"file-watcher-instance.key-0\",\"@timestamp\":\"2020-03-13T16:20:45.464-05:00\",\"level\":\"INFO\",\"file\":\"FileWatchingX509ExtendedKeyManager.java\",\"method\":\"run\",\"logger_name\":\"org.cloudfoundry.security.FileWatchingX509ExtendedKeyManager\",\"exception\":{\"exception_class\":null,\"exception_message\":null,\"stacktrace\":null}}",
"origin":"rep",
"source_instance":"0",
"source_type":"APP/PROC/WEB",
"time":"2020-03-13T21:20:46Z",
"timestamp":1584134445464682039}

```

Config File:

```
filter {

grok {
            match => ["message", "(?<json_data>{.*})"]}

json {
            source => "json_data"
			
json {
            source => "[json_data][msg]"
			target => "Pivotalmsg"}
}

```

My "msg" field still doesn't get parsed, the json blob just populates the field. New to this and have 0 idea what i'm doing, any help is greatly appreciated.

---

<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:** [March 14, 2020, 12:10am UTC](https://discuss.elastic.co/t/parsing-json-nested-in-json-from-log-firehose/223593/2 "2020-03-14T00:10:05Z")

</div>

> [@Drob](#):
>
> source =\> "[json\_data][msg]"

You have not included a target option on the first filter, so [msg] will exist at the top level. Thus this should be

```
source => [msg]

```

---

<div class="post-metadata">

**Author:** ![Drob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drob/32/64446_2.png) [@Drob](https://discuss.elastic.co/u/Drob)\
**Post date:** [March 18, 2020, 6:22pm UTC](https://discuss.elastic.co/t/parsing-json-nested-in-json-from-log-firehose/223593/3 "2020-03-18T18:22:04Z")

</div>

Thank you! I thought something like that but online examples don't make it clear.

---

<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:** [April 15, 2020, 6:22pm UTC](https://discuss.elastic.co/t/parsing-json-nested-in-json-from-log-firehose/223593/4 "2020-04-15T18:22:06Z")

</div>

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