# Help for new logstash filter : docker metadata

**URL:** https://discuss.elastic.co/t/help-for-new-logstash-filter-docker-metadata/24237
**Category:** Logstash
**Created:** [June 24, 2015, 7:16am UTC](https://discuss.elastic.co/t/help-for-new-logstash-filter-docker-metadata/24237 "2015-06-24T07:16:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tgermain](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tgermain](https://discuss.elastic.co/u/tgermain)
#### Post date: [June 24, 2015, 7:16am UTC](https://discuss.elastic.co/t/help-for-new-logstash-filter-docker-metadata/24237/1 "2015-06-24T07:16:48Z")

</div>

(from [https://github.com/elastic/logstash/issues/3494](https://github.com/elastic/logstash/issues/3494) )

Hi,

I'm trying to adapt this fluentd filter ([https://github.com/fabric8io/fluent-plugin-docker\_metadata\_filter](https://github.com/fabric8io/fluent-plugin-docker_metadata_filter)) into a logstash filter.

It does not seam really hard. The plugin basically do :

1. extract the id of the container from the path of it's logfile

2. call the docker api to get metadata with `Docker::Container.get(container_id).info`

3. put those metadata into fields

Since I don't have any Ruby background, I'm struggling to adapt the code and to test it.

Any help would be welcome.

---

<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: [July 6, 2017, 5:36am UTC](https://discuss.elastic.co/t/help-for-new-logstash-filter-docker-metadata/24237/2 "2017-07-06T05:36:39Z")

</div>


