# Is possible send logs from specific kubernetes namespaces to diferent elasticsearch using logstash?

**URL:** <https://discuss.elastic.co/t/is-possible-send-logs-from-specific-kubernetes-namespaces-to-diferent-elasticsearch-using-logstash/231030>\
**Category:** Logstash\
**Created:** [May 4, 2020, 8:15pm UTC](https://discuss.elastic.co/t/is-possible-send-logs-from-specific-kubernetes-namespaces-to-diferent-elasticsearch-using-logstash/231030 "2020-05-04T20:15:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adonai\_Costa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adonai_costa/32/63579_2.png) [@Adonai\_Costa](https://discuss.elastic.co/u/Adonai_Costa)\
**Post date:** [May 4, 2020, 8:15pm UTC](https://discuss.elastic.co/t/is-possible-send-logs-from-specific-kubernetes-namespaces-to-diferent-elasticsearch-using-logstash/231030/1 "2020-05-04T20:15:04Z")

</div>

I have 1 kubernetes cluster send all logs to logstash, this logstash send log to elasticsearch.

It's possible send logs from diferent pods of namespaces to diferent elasticsearchs using logstash? how can I do that?

---

<div class="post-metadata">

**Author:** ![KoettingSimon](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KoettingSimon](https://discuss.elastic.co/u/KoettingSimon)\
**Post date:** [May 4, 2020, 8:24pm UTC](https://discuss.elastic.co/t/is-possible-send-logs-from-specific-kubernetes-namespaces-to-diferent-elasticsearch-using-logstash/231030/2 "2020-05-04T20:24:29Z")

</div>

Hi, welcome to the Forum!  
Yes you can. In a logstash pipeline output section you can use if else statements.

So you need a field in you logs with the namespace of the pod, then you can define if pod namespace = a {Elasticsearch output 1} and so on.

You can find some examples at this documentation section: [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals)

Hope this will help,  
Simon

---

<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:** [June 1, 2020, 8:24pm UTC](https://discuss.elastic.co/t/is-possible-send-logs-from-specific-kubernetes-namespaces-to-diferent-elasticsearch-using-logstash/231030/3 "2020-06-01T20:24:30Z")

</div>

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