# Filebeat custom index name without logstash

**URL:** https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885
**Category:** Beats
**Tags:** filebeat
**Created:** [December 21, 2018, 6:21pm UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885 "2018-12-21T18:21:15Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![pranay\_sankpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pranay_sankpal/32/44084_2.png) [@pranay\_sankpal](https://discuss.elastic.co/u/pranay_sankpal)
#### Post date: [December 21, 2018, 6:21pm UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/1 "2018-12-21T18:21:16Z")

</div>

I want to change name of the index.

[https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html#index-option-es](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html#index-option-es)  
I'm referring above link. following is the filebeat.yml file. I'm not seeing any index in kibana.

```auto
 filebeat.inputs:
    - type: log
      paths:
        - /var/www/myapp/**/runtime/debug/*.data
      fields:
        log_type: debugdata

      tags: ["myapp-logs"]
      json.keys_under_root: true
      json.add_error_key: true
      json.message_key: log

    setup.template.name: "debugdata"
    setup.template.pattern: "debugdata-*"

    cloud.id: ${ELASTIC_CLOUD_ID}
    cloud.auth: ${ELASTIC_CLOUD_AUTH}

    output.elasticsearch:
      hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
      username: ${ELASTICSEARCH_USERNAME}
      password: ${ELASTICSEARCH_PASSWORD}
      index: "%{[fields.log_type]}-%{[beat.version]}-%{+yyyy.MM.dd}"

```

Attached is the list of indices.

 ![34%20PM](https://us1.discourse-cdn.com/elastic/original/3X/a/f/afef8f776172c050d942396365a15ba12bb0dfd3.png)

what changes do i need to make to create custom index name.?  
Expecting debugdata-7.0.0-alpha1-2018-20-21

---

<div class="post-metadata">

### Author: ![rayl7786](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rayl7786](https://discuss.elastic.co/u/rayl7786)
#### Post date: [December 21, 2018, 6:35pm UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/2 "2018-12-21T18:35:15Z")

</div>

Wouldn't you need to specify the index name under the ES output?

> output.elasticsearch:  
> hosts: ['${ELASTICSEARCH\_HOST:elasticsearch}:${ELASTICSEARCH\_PORT:9200}']  
> username: ${ELASTICSEARCH\_USERNAME}  
> password: ${ELASTICSEARCH\_PASSWORD}  
> index: "debugdata-%{[beat.version]}-%{+yyyy.MM.dd}"

---

<div class="post-metadata">

### Author: ![pranay\_sankpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pranay_sankpal/32/44084_2.png) [@pranay\_sankpal](https://discuss.elastic.co/u/pranay_sankpal)
#### Post date: [December 21, 2018, 6:38pm UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/3 "2018-12-21T18:38:44Z")

</div>

I couldn't get what you are trying to explain. It's under ES output, right? Can you show the example?

---

<div class="post-metadata">

### Author: ![rayl7786](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rayl7786](https://discuss.elastic.co/u/rayl7786)
#### Post date: [December 21, 2018, 7:37pm UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/4 "2018-12-21T19:37:16Z")

</div>

Sorry, I misread your filebeat.yml file. I now see you have added a custom field and are calling that field to be used for the index name. To me everything looks good in the config, not sure if you need to set it to overwrite the existing template

setup.template.overwrite: true

---

<div class="post-metadata">

### Author: ![pranay\_sankpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pranay_sankpal/32/44084_2.png) [@pranay\_sankpal](https://discuss.elastic.co/u/pranay_sankpal)
#### Post date: [December 22, 2018, 3:18am UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/5 "2018-12-22T03:18:52Z")

</div>

@rayi7786 tried setting `setup.template.overwrite: true`, no luck with it. Is there a way to debug the issue?

---

<div class="post-metadata">

### Author: ![pranay\_sankpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pranay_sankpal/32/44084_2.png) [@pranay\_sankpal](https://discuss.elastic.co/u/pranay_sankpal)
#### Post date: [December 23, 2018, 8:22am UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/6 "2018-12-23T08:22:50Z")

</div>

Any suggestions?

---

<div class="post-metadata">

### Author: ![pranay\_sankpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pranay_sankpal/32/44084_2.png) [@pranay\_sankpal](https://discuss.elastic.co/u/pranay_sankpal)
#### Post date: [December 25, 2018, 8:27am UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/7 "2018-12-25T08:27:17Z")

</div>

@Christian_Dahlqvist sir, could you please help here?

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [December 27, 2018, 2:37pm UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/8 "2018-12-27T14:37:19Z")

</div>

The indentation looks off.

```auto
filebeat.inputs:
    - type: log
      paths:
        - /var/www/myapp/**/runtime/debug/*.data
      fields:
        log_type: debugdata

      tags: ["myapp-logs"]
      
      json.keys_under_root: true
      json.add_error_key: true
      json.message_key: log

setup.template.name: "debugdata"
setup.template.pattern: "debugdata-*"

cloud.id: ${ELASTIC_CLOUD_ID}
cloud.auth: ${ELASTIC_CLOUD_AUTH}

output.elasticsearch:
  hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
  username: ${ELASTICSEARCH_USERNAME}
  password: ${ELASTICSEARCH_PASSWORD}
  index: "%{[fields.log_type]}-%{[beat.version]}-%{+yyyy.MM.dd}"

```

fixing the indentation I think it should work.

---

<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 24, 2019, 2:37pm UTC](https://discuss.elastic.co/t/filebeat-custom-index-name-without-logstash/161885/9 "2019-01-24T14:37:20Z")

</div>

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