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

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:

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:

{
  "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:

setup.template:
  enabled: true
  settings:

to test-idx.json and set template name.

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