# Unable to get namespace as index name

**URL:** <https://discuss.elastic.co/t/unable-to-get-namespace-as-index-name/211578>\
**Category:** Logstash\
**Created:** [December 12, 2019, 7:12am UTC](https://discuss.elastic.co/t/unable-to-get-namespace-as-index-name/211578 "2019-12-12T07:12:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepk1210](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepk1210/32/45812_2.png) [@sandeepk1210](https://discuss.elastic.co/u/sandeepk1210)\
**Post date:** [December 12, 2019, 7:12am UTC](https://discuss.elastic.co/t/unable-to-get-namespace-as-index-name/211578/1 "2019-12-12T07:12:16Z")

</div>

Hi Guys,

**Requirement** : Have INDEX name as FILEBEAT-NAMESPACE-YYYYMMDD

**Issue** : I am unable to get NAMESPACE resolved to be the kubernetes namespace, with whatever option I try.

**Application** : Logstash 7.4.1 is deployed using Kubernetes.  
Following is how logstash.yml look like:

```
logstashPipeline:
  logstash.conf: |
    input {
       beats {
         port => 5044
       }
    }
    output {
      elasticsearch {
        hosts => ["https://elasticsearch-master:9200"]
        manage_template => false
        index => "%{[@metadata][beat]}-%{[attrs][container.labels.io_kubernetes_pod_namespace]}-%{+YYYY.MM.dd}"
        document_type => "%{[@metadata][type]}"
      }
    }

```

**Issue** : Index name is coming as filebeat-%{[attrs][container.labels.io\_kubernetes\_pod\_namespace]}-2019.12.12, whereas expected as "filebeat-NAMESPACE-2019.12.12.

Any suggestions please?

---

<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:** [January 9, 2020, 7:12am UTC](https://discuss.elastic.co/t/unable-to-get-namespace-as-index-name/211578/2 "2020-01-09T07:12:27Z")

</div>

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