# Will filebeat create non default index if i need one?

**URL:** <https://discuss.elastic.co/t/will-filebeat-create-non-default-index-if-i-need-one/183355>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 29, 2019, 2:09pm UTC](https://discuss.elastic.co/t/will-filebeat-create-non-default-index-if-i-need-one/183355 "2019-05-29T14:09:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@Jonny](https://discuss.elastic.co/u/Jonny)\
**Post date:** [May 29, 2019, 2:09pm UTC](https://discuss.elastic.co/t/will-filebeat-create-non-default-index-if-i-need-one/183355/1 "2019-05-29T14:09:16Z")

</div>

Hi all !

Did not get an idea of

```
output.elasticsearch:
    worker: 3
    hosts: ["127.0.0.1:9200"]
    index: "acc-%{[agent.version]}-%{+yyyy.MM.dd}"

```

Am i right that new index will be created instead of using default filebeat.... ?

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [May 30, 2019, 4:51pm UTC](https://discuss.elastic.co/t/will-filebeat-create-non-default-index-if-i-need-one/183355/2 "2019-05-30T16:51:54Z")

</div>

Yes, you can! After changing the `output.elasticsearch.index` here as you've already done, you also need to change `setup.template.name` and `setup.template.pattern` to match your customized index name. Please see [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) for more details.

---

<div class="post-metadata">

**Author:** ![Jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@Jonny](https://discuss.elastic.co/u/Jonny)\
**Post date:** [May 31, 2019, 5:14am UTC](https://discuss.elastic.co/t/will-filebeat-create-non-default-index-if-i-need-one/183355/3 "2019-05-31T05:14:30Z")

</div>

Thank you for replying.

Then i have a problem with it.

My filebeat.yml content is:

```
setup.template.enabled: true
setup.template.name: "acc-%{[agent.version]}"
setup.template.pattern: "acc-%{[agent.version]}-*"
setup.template.overwrite: true

filebeat.inputs:
  - type:
    paths:
      - C:\Users\Evgeny.Poshvin\PycharmProjects\aba\autotests-backup-core\reports\_debug_version_testcases.json
    json.keys_under_root: true
    json.add_error_key: true

output.elasticsearch:
  worker: 3
  hosts: ["127.0.0.1:9200"]
  index: "acc-%{[agent.version]}-%{+yyyy.MM.dd}"

```

What i suppose to get is index acc..... Template also has prefix acc... and it takes  
default fields.yml.

When i run

```
filebeat run -c filebeat.yml

```

and then fill \_debug\_version\_testcases.json with strings i still get filebeat.... default index.

What's wrong ?

---

<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 28, 2019, 5:14am UTC](https://discuss.elastic.co/t/will-filebeat-create-non-default-index-if-i-need-one/183355/4 "2019-06-28T05:14:42Z")

</div>

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