# Need to create unique index names for metric and filebeat where logs/metrics of one particular namespace would flow

**URL:** <https://discuss.elastic.co/t/need-to-create-unique-index-names-for-metric-and-filebeat-where-logs-metrics-of-one-particular-namespace-would-flow/288580>\
**Category:** Metrics\
**Created:** [November 8, 2021, 1:47am UTC](https://discuss.elastic.co/t/need-to-create-unique-index-names-for-metric-and-filebeat-where-logs-metrics-of-one-particular-namespace-would-flow/288580 "2021-11-08T01:47:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sidharth\_vijayakumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sidharth_vijayakumar/32/97257_2.png) [@sidharth\_vijayakumar](https://discuss.elastic.co/u/sidharth_vijayakumar)\
**Post date:** [November 8, 2021, 1:47am UTC](https://discuss.elastic.co/t/need-to-create-unique-index-names-for-metric-and-filebeat-where-logs-metrics-of-one-particular-namespace-would-flow/288580/1 "2021-11-08T01:47:08Z")

</div>

Usually all logs/Metrics goes to a common index but need a solution where dev namespace logs goes to filebeat-dev-\*

How do i do this in filebeat i do not have logstash or any pipelines

---

<div class="post-metadata">

**Author:** ![sidharth\_vijayakumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sidharth_vijayakumar/32/97257_2.png) [@sidharth\_vijayakumar](https://discuss.elastic.co/u/sidharth_vijayakumar)\
**Post date:** [November 8, 2021, 1:47am UTC](https://discuss.elastic.co/t/need-to-create-unique-index-names-for-metric-and-filebeat-where-logs-metrics-of-one-particular-namespace-would-flow/288580/2 "2021-11-08T01:47:44Z")

</div>

You can resolved this issue by using below in filbeat.yml fileoutput.Elasticsearch:  
output.Elasticsearch:  
indices:

- index: "filebeat-namespacename-%{[agent.version]}-%{+yyyy.MM.dd}"  
when.equals:  
kubernetes.namespace: "dev"

Once u do this restart filbeat then next create index pattern this should be listed when u created an index pattern.

---

<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 6, 2021, 1:48am UTC](https://discuss.elastic.co/t/need-to-create-unique-index-names-for-metric-and-filebeat-where-logs-metrics-of-one-particular-namespace-would-flow/288580/3 "2021-12-06T01:48:16Z")

</div>

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