# Unable to do \`filebeat setup ...\` for custom \`filebeat\` index name

**URL:** https://discuss.elastic.co/t/unable-to-do-filebeat-setup-for-custom-filebeat-index-name/294968
**Category:** Beats
**Tags:** filebeat
**Created:** [January 20, 2022, 3:54pm UTC](https://discuss.elastic.co/t/unable-to-do-filebeat-setup-for-custom-filebeat-index-name/294968 "2022-01-20T15:54:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)
#### Post date: [January 20, 2022, 3:54pm UTC](https://discuss.elastic.co/t/unable-to-do-filebeat-setup-for-custom-filebeat-index-name/294968/1 "2022-01-20T15:54:44Z")

</div>

I'm attempting to do a `filebeat setup ...` with Filebeat 7.16.0/Elasticsearch 7.16.2 for a custom index (`foo-filebeat-7.16.0-*`). However, it always loads the template, etc. for `filebeat-7.16.0-*`. I'm pretty sure this is a simple error in my config, but not certain what.

The command I'm using to do the setup is:

```bash
filebeat setup --strict.perms=false --index-management --pipelines --modules <list of modules> -e -d --path.config=$(pwd)

```

And my `filebeat.yml` is:

```auto
---
setup:
  kibana:
    host: '${KIBANA_URL}'
    protocol: 'https'
    username: '${USER}'
    password: '${PASSWORD}'
    ssl:
      enabled: true
      verification_mode: 'none'

  ilm:
    enabled: 'true'
    pattern: '000001'

  template:
    name: 'foo-filebeat'
    pattern: 'foo-filebeat-*'
    settings:
      index:
        final_pipeline: 'filebeat-final-pipeline'

output:
  elasticsearch:
    index: 'foo-filebeat-%{[agent.version]}'
    hosts:
      - '${ELASTICSEARCH_URL}'
    protocol: 'https'
    username: '${USER}'
    password: '${PASSWORD}'
    ssl:
      enabled: true
      verification_mode: 'none'

```

**Additionally:** Is there a way to add an alias to the initial template at the time it's uploaded? My setup script currently pulls the template from Elasticsearch after it's been uploaded by `filebeat`, adds the required aliases, and then loads it back into Elasticsearch.

---

<div class="post-metadata">

### Author: ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)
#### Post date: [January 20, 2022, 4:07pm UTC](https://discuss.elastic.co/t/unable-to-do-filebeat-setup-for-custom-filebeat-index-name/294968/2 "2022-01-20T16:07:32Z")

</div>

I see the issue, according to [this page](https://www.elastic.co/guide/en/beats/filebeat/current/change-index-name.html):

![image](https://us1.discourse-cdn.com/elastic/original/3X/9/7/97cd336f83e84579ddf0d5b603cfb50bef641618.png)

I should be able to simply script a template download, update the template offline, then upload it and manually create the updated index. Not ideal, but workable.

---

<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: [February 17, 2022, 6:08pm UTC](https://discuss.elastic.co/t/unable-to-do-filebeat-setup-for-custom-filebeat-index-name/294968/3 "2022-02-17T18:08:27Z")

</div>

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