# Variable in setup.template.json.path file not work?

**URL:** <https://discuss.elastic.co/t/variable-in-setup-template-json-path-file-not-work/297520>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 17, 2022, 4:36pm UTC](https://discuss.elastic.co/t/variable-in-setup-template-json-path-file-not-work/297520 "2022-02-17T16:36:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![acidborn601](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@acidborn601](https://discuss.elastic.co/u/acidborn601)\
**Post date:** [February 17, 2022, 4:36pm UTC](https://discuss.elastic.co/t/variable-in-setup-template-json-path-file-not-work/297520/1 "2022-02-17T16:36:01Z")

</div>

Hello!  
I use Elasticsearch 7.15.1 with filebeat 7.15.1 and have some questions:  
First: i use this config on filebeat and work fine:

```auto
setup.template:
  enabled: true
  settings:
    index.number_of_shards: 5
    index.number_of_replicas: 1
    index.number_of_routing_shards: 5
    index.refresh_interval: "60s"
  json.enabled: false
  json.name: "test-idx"
  json.path: "/etc/filebeat/test-idx.json"
setup.ilm:
  enabled: true
  rollover_alias: test-idx
  policy_name: test-idx-%{[agent.version]}
  overwrite: true
  policy_file: /etc/filebeat/test-idx.json

```

Next i try change `json.enabled: false` to `json.enabled: true`. Config of `/etc/filebeat/test-idx.json`:

```auto
{
  "mappings": {
    "dynamic_templates": [],
    "dynamic": "strict",
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "beat": {
        "properties": {
          "hostname": {
            "ignore_above": 1024,
            "type": "keyword"
          },
          "name": {
            "ignore_above": 1024,
            "type": "keyword"
          }
        }
      },
      "input_type": {
        "ignore_above": 1024,
        "type": "keyword"
      },
      "message": {
        "norms": false,
        "type": "text"
      }
    }
  },  
  "settings": {
      "index.lifecycle.name": "test-idx-%{[agent.version]}",
      "index.number_of_shards": 5,
      "index.number_of_replicas": 1,
      "index.number_of_routing_shards": 5,
      "index.refresh_interval": "60s"
  },
  "template": "test-idx-*"
}

```

When i start filebeat index template created, but ILM mapped to test-idx-%{[agent.version]}.  
Why not a test-idx-7.15.1?

And second question:  
If i stay `test-idx.json` empty, setup filebeat template not working. Me need duplicate from `filebeat.yml` section:

```auto
setup.template:
  enabled: true
  settings:

```

to `test-idx.json` and set template name.

---

<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:** [March 17, 2022, 6:36pm UTC](https://discuss.elastic.co/t/variable-in-setup-template-json-path-file-not-work/297520/2 "2022-03-17T18:36:17Z")

</div>

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