# Setup.template.name not work

**URL:** <https://discuss.elastic.co/t/setup-template-name-not-work/311160>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 1, 2022, 9:15pm UTC](https://discuss.elastic.co/t/setup-template-name-not-work/311160 "2022-08-01T21:15:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pi314](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@pi314](https://discuss.elastic.co/u/pi314)\
**Post date:** [August 1, 2022, 9:15pm UTC](https://discuss.elastic.co/t/setup-template-name-not-work/311160/1 "2022-08-01T21:15:20Z")

</div>

I am sending logs to elastic using filebeat but it is not creating the index with the desired name.

```auto
filebeat version 7.11.0 (amd64), libbeat 7.11.0 [84c4d4c4034fcb49c1a318ccdc7311d70adee15b built 2021-02-08 22:42:11 +0000 UTC]

```

This is my config:

```auto
logging.metrics.period: 1m
logging.to_files: true
logging.files:
  rotateeverybytes: 16777216
  keepfiles: 7
  permissions: 0600

setup.template.name: "log_prod_services"
setup.template.overwrite: true
setup.template.pattern: "log_prod_services-*"
setup.template.settings:
  index.number_of_shards: 3
  index.number_of_replicas: 1

filebeat.inputs:
- type: log
  enabled: true
  json.keys_under_root: true
  json.overwrite_keys: true
  fields_under_root: true
  fields: {
    app : 01
  }
  paths: 
   - "/var/log/01/operations.log" 
   - "/var/log/01/operations_debug.log" 
 
 
- type: log 
  enabled: true 
  json.keys_under_root: true 
  json.overwrite_keys: true 
  fields_under_root: true 
  fields: { 
    app: 02
  } 
  paths: 
   - "/var/log/02/operations.log" 
   - "/var/log/02/operations_debug.log" 
 
output.elasticsearch: 
 hosts: ["10.x.x.x:9200"]
 indices: 
   - index: "log_prod_services-01-%{+yyyy.MM.dd}" 
     when.contains: 
       app: "01" 
   - index: "log_prod_services-02-%{+yyyy.MM.dd}"    
     when.contains: 
       app: "02"

```

In the logs i see this:

```auto
2022-08-01T20:56:37.642Z INFO [index-management] idxmgmt/std.go:407 Set setup.template.name to '{filebeat-7.11.0 {now/d}-000001}' as ILM is enabled.
2022-08-01T20:56:37.642Z INFO [index-management] idxmgmt/std.go:412 Set setup.template.pattern to 'filebeat-7.11.0-*' as ILM is enabled.
2022-08-01T20:56:37.642Z INFO [index-management] idxmgmt/std.go:446 Set settings.index.lifecycle.rollover_alias in template to {filebeat-7.11.0 {now/d}-000001} as ILM is enabled.
2022-08-01T20:56:37.642Z INFO [index-management] idxmgmt/std.go:450 Set settings.index.lifecycle.name in template to {filebeat {"policy":{"phases":{"hot":{"actions":{"rollover":{"max_age":"30d","max_size":"50gb"}}}}}}} as ILM is enabled.
2022-08-01T20:56:38.153Z INFO template/load.go:97 Template filebeat-7.11.0 already exists and will not be overwritten.
2022-08-01T20:56:38.153Z INFO [index-management] idxmgmt/std.go:298 Loaded index template.

```

any helps??

---

<div class="post-metadata">

**Author:** ![Andrea\_Spacca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrea_spacca/32/76976_2.png) [@Andrea\_Spacca](https://discuss.elastic.co/u/Andrea_Spacca)\
**Post date:** [August 2, 2022, 5:22am UTC](https://discuss.elastic.co/t/setup-template-name-not-work/311160/2 "2022-08-02T05:22:34Z")

</div>

Hello @pi314

The following does not seems to be right settings for ILM:

> [@pi314](#):
>
> ```auto
> setup.template.name: "log_prod_services"
> setup.template.pattern: "log_prod_services-*"
> 
> ```

```auto
setup.template. rollover_alias: "log_prod_services-"
setup.template.pattern: "{now/d}-01"

```

Anyway if I got it right you would like to define two different writing aliases: `log_prod_services-01` and `log_prod_services-02` where `-0X` is `-{app}`, is this correct?

This cannot be achieved with ILM on Filebeat side, as the `-0X` will be the incremented index of a rollover target (see: [Rollover index API | Elasticsearch Guide [7.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.11/indices-rollover-index.html))

---

<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:** [August 30, 2022, 7:23am UTC](https://discuss.elastic.co/t/setup-template-name-not-work/311160/3 "2022-08-30T07:23:31Z")

</div>

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