# Parsing dockers files with logstash

**URL:** <https://discuss.elastic.co/t/parsing-dockers-files-with-logstash/123717>\
**Category:** Logstash\
**Created:** [March 13, 2018, 10:42am UTC](https://discuss.elastic.co/t/parsing-dockers-files-with-logstash/123717 "2018-03-13T10:42:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asier\_Saluena](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Asier\_Saluena](https://discuss.elastic.co/u/Asier_Saluena)\
**Post date:** [March 13, 2018, 10:42am UTC](https://discuss.elastic.co/t/parsing-dockers-files-with-logstash/123717/1 "2018-03-13T10:42:02Z")

</div>

Hi, I'm including my dockers json logs to the ELK stack, but I can't send them to ES and I don't know why not  
My filebeat shipper look like this:

> ```
> - type: log
> paths:
> json.message_key: log
> json.keys_under_root: true
> fields.doc_type: json_docker
> 
> ```

My Logstash config file just do this:

> ```
> output {
> if [fields][doc_type] == "json_docker" {
> elasticsearch {
> hosts => ["10.0.11.30:9200"]
> sniffing => true
> manage_template => false
> index => "%{host}_json-%{+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:** [March 13, 2018, 11:01am UTC](https://discuss.elastic.co/t/parsing-dockers-files-with-logstash/123717/2 "2018-03-13T11:01:37Z")

</div>

With `keys_under_root` enabled the `doc_type` field won't end up under `fields`. Dump the event with a `stdout { codec => rubydebug }` to inspect exactly what you have.

---

<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 10, 2018, 11:01am UTC](https://discuss.elastic.co/t/parsing-dockers-files-with-logstash/123717/3 "2018-04-10T11:01:56Z")

</div>

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