# Dynamic pipeline selection with Kubernetes Autodiscover hints

**URL:** <https://discuss.elastic.co/t/dynamic-pipeline-selection-with-kubernetes-autodiscover-hints/157444>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 19, 2018, 9:28pm UTC](https://discuss.elastic.co/t/dynamic-pipeline-selection-with-kubernetes-autodiscover-hints/157444 "2018-11-19T21:28:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spiffytech](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spiffytech/32/28062_2.png) [@spiffytech](https://discuss.elastic.co/u/spiffytech)\
**Post date:** [November 19, 2018, 9:28pm UTC](https://discuss.elastic.co/t/dynamic-pipeline-selection-with-kubernetes-autodiscover-hints/157444/1 "2018-11-19T21:28:53Z")

</div>

I'm using Filebeat in Kubernetes with Autodiscover turned on. How can I route a specific container's logs to a specific ElasticSearch ingest pipeline, so that I can process the logs with the appropriate format grok pattern?

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [November 20, 2018, 1:45pm UTC](https://discuss.elastic.co/t/dynamic-pipeline-selection-with-kubernetes-autodiscover-hints/157444/2 "2018-11-20T13:45:41Z")

</div>

Hello @spiffytech

You could route events with specific labels to specific indices/pipeline.

```auto
output.elasticsearch:
  hosts: ["http://xxxxxxx:9200"]
  index: "filebeat-%{[beat.version]}-%{+yyyy.MM}"
  indices:
  - index: "filebeat--%{[beat.version]}-%{+yyyy.MM}"
    pipeline: pihole-logging
    when.is:
      myfield: "myfieldvalue"

```

See [https://www.elastic.co/guide/en/beats/filebeat/6.5/elasticsearch-output.html#indices-option-es](https://www.elastic.co/guide/en/beats/filebeat/6.5/elasticsearch-output.html#indices-option-es) for more details.

---

<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:** [December 18, 2018, 1:45pm UTC](https://discuss.elastic.co/t/dynamic-pipeline-selection-with-kubernetes-autodiscover-hints/157444/3 "2018-12-18T13:45:41Z")

</div>

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