# Logstash filter to parse json --\> json deserialized string

**URL:** <https://discuss.elastic.co/t/logstash-filter-to-parse-json-json-deserialized-string/114445>\
**Category:** Logstash\
**Created:** [January 8, 2018, 3:08am UTC](https://discuss.elastic.co/t/logstash-filter-to-parse-json-json-deserialized-string/114445 "2018-01-08T03:08:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akustic](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@akustic](https://discuss.elastic.co/u/akustic)\
**Post date:** [January 8, 2018, 3:08am UTC](https://discuss.elastic.co/t/logstash-filter-to-parse-json-json-deserialized-string/114445/1 "2018-01-08T03:08:46Z")

</div>

I have some log files I want to parse and they are in the following format.

{"log":"{"@timestamp":"2018-01-08T02:11:35.651+00:00","@version":1,"message":"\u001B[36mFinished \u001B[0m:get / for 139.162.106.181 in (1 ms) Status: \u001B[39m200\u001B[0m","logger\_name":"ring.logger.tools-logging","thread\_name":"worker-1","level":"INFO","level\_value":20000}\n","stream":"stdout","time":"2018-01-08T02:11:35.651496485Z"}

It is json, but the inner block is a string of json, how would I parse this?

What I have so far.

input {  
file {  
path =\> ["/var/log/containers/\*.log"]  
}  
}

filter {  
grok {  
match =\> { "path" =\> "/var/log/containers/%{NOTSPACE:service}_%{NOTSPACE:namespace}_%{NOTSPACE:pod}\*.log" }  
}  
json {  
source =\> "message"  
}  
}

output {  
elasticsearch {  
hosts =\> ["[https://elasticsearch.bleh.com:9200](https://elasticsearch.bleh.com:9200)"]  
ssl =\> true  
index =\> "logz-%{namespace}-%{+YYYY.MM.dd}"  
}  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 8, 2018, 8:18am UTC](https://discuss.elastic.co/t/logstash-filter-to-parse-json-json-deserialized-string/114445/2 "2018-01-08T08:18:19Z")

</div>

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

The JSON string appears to be in the `log` field, not `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:** [February 5, 2018, 8:25am UTC](https://discuss.elastic.co/t/logstash-filter-to-parse-json-json-deserialized-string/114445/3 "2018-02-05T08:25:08Z")

</div>

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