Metricbeat and Heartbeat 8.x custom index Name should pickup from template ,but creates always bedefault index name

8.7.1 Works exactly the same using the process above (manually installing ILM and Template) I just changed the version numbers from 8.8.0 to 8.7.1
I am not sure what your issue is. I just tested it, works exactly the same you have a typo or mismatch somewhere

My 8.7.1

setup.ilm.enabled: false
setup.template.enabled: false
output.elasticsearch:
  hosts: ["http://localhost:9200"]
  index: "cis-metric-%{[agent.version]}"   

After running metricbeat 8.7.1

GET _data_stream/cis-metric-8.7.1

{
  "data_streams": [
    {
      "name": "cis-metric-8.7.1",
      "timestamp_field": {
        "name": "@timestamp"
      },
      "indices": [
        {
          "index_name": ".ds-cis-metric-8.7.1-2023.07.11-000001",
          "index_uuid": "6c6CMe6IStqPsnQ5EMN4qw"
        }
      ],
      "generation": 1,
      "status": "YELLOW",
      "template": "cis-metric-8.7.1",
      "ilm_policy": "cis-metric-policy",
      "hidden": false,
      "system": false,
      "allow_custom_routing": false,
      "replicated": false
    }
  ]
}

Sure we put the version number in to allow for changes between versions if needed.

You will just need to make sure you make the proper changes and take out the version number everywhere...

But the fact it is not working means you have something else going on... you should find it....

Just for reference here is the 8.7.1 code I gave you the metricbeat.yml section above

GET _data_stream/cis-metric-8.7.1

DELETE _data_stream/cis-metric-8.7.1

GET _ilm/policy/cis-metric-policy

DELETE _ilm/policy/cis-metric-policy

PUT _ilm/policy/cis-metric-policy
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_age": "30d",
            "max_primary_shard_size": "50gb"
          }
        }
      }
    }
  }
}

DELETE _index_template/cis-metric-8.7.1

PUT _index_template/cis-metric-8.7.1
{
  "index_patterns": [
    "cis-metric-8.7.1"
  ],
  "template": {
    "settings": {
      "index": {
        "lifecycle": {
          "name": "cis-metric-policy"
        },
        "mapping": {
          "total_fields": {
            "limit": "10000"
          }
        },
        "number_of_shards": "1"
      }
    },
    "mappings": {
      "properties": {
        "system.cpu.iowait.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.process.memory.rss.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.diskio.write.bytes": {
          "type": "long"
        },
        "system.load.cores": {
          "type": "long"
        },
        "system.process.cpu.total.value": {
          "type": "long"
        },
        "service.type": {
          "type": "keyword"
        },
        "system.diskio.iostat.service_time": {
          "type": "float"
        },
        "system.memory.actual.free": {
          "type": "long"
        },
        "system.cpu.idle.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "agent.name": {
          "type": "keyword"
        },
        "system.memory.total": {
          "type": "long"
        },
        "system.diskio.write.time": {
          "type": "long"
        },
        "process.ppid": {
          "type": "long"
        },
        "system.diskio.iostat.write.await": {
          "type": "float"
        },
        "system.fsstat.total_size.free": {
          "type": "long"
        },
        "system.memory.free": {
          "type": "long"
        },
        "system.memory.swap.free": {
          "type": "long"
        },
        "system.memory.actual.used.pct": {
          "scaling_factor": 100,
          "type": "scaled_float"
        },
        "system.diskio.iostat.queue.avg_size": {
          "type": "float"
        },
        "agent.id": {
          "type": "keyword"
        },
        "system.memory.actual.used.bytes": {
          "type": "long"
        },
        "system.diskio.iostat.busy": {
          "type": "float"
        },
        "system.diskio.name": {
          "type": "keyword"
        },
        "system.cpu.user.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.memory.used.bytes": {
          "type": "long"
        },
        "system.network.name": {
          "type": "keyword"
        },
        "system.diskio.iostat.request.avg_size": {
          "type": "float"
        },
        "system.diskspace.usage": {
          "type": "long"
        },
        "system.cpu.system.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.diskio.iostat.read.request.merges_per_sec": {
          "type": "float"
        },
        "system.cpu.irq.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "process.type": {
          "type": "keyword"
        },
        "process.details": {
          "type": "keyword"
        },
        "system.cpu.user.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "user.name": {
          "type": "text",
          "fields": {
            "keyword": {
              "ignore_above": 256,
              "type": "keyword"
            }
          }
        },
        "system.network.in.bytes": {
          "type": "long"
        },
        "system.network.in.dropped": {
          "type": "long"
        },
        "system.diskio.io.ops": {
          "type": "long"
        },
        "mountpoint.details": {
          "type": "keyword"
        },
        "system.diskio.iostat.write.per_sec.bytes": {
          "type": "float"
        },
        "system.fsstat.count": {
          "type": "long"
        },
        "system.load.1": {
          "scaling_factor": 100,
          "type": "scaled_float"
        },
        "system.process.cpu.total.ticks": {
          "type": "long"
        },
        "system.cpu.softirq.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.cpu.nice.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.load.5": {
          "scaling_factor": 100,
          "type": "scaled_float"
        },
        "metricset.period": {
          "type": "long"
        },
        "system.diskio.iostat.read.per_sec.bytes": {
          "type": "float"
        },
        "system.process.memory.share": {
          "type": "long"
        },
        "process.pgid": {
          "type": "long"
        },
        "system.process.memory.rss.bytes": {
          "type": "long"
        },
        "@timestamp": {
          "type": "date"
        },
        "system.network.in.errors": {
          "type": "long"
        },
        "system.process.cpu.total.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.cpu.nice.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.memory.used.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.diskio.iostat.read.await": {
          "type": "float"
        },
        "system.cpu.irq.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "process.pid": {
          "type": "long"
        },
        "system.load.norm.15": {
          "scaling_factor": 100,
          "type": "scaled_float"
        },
        "system.diskio.read.count": {
          "type": "long"
        },
        "system.filesystem.used.pct": {
          "type": "float"
        },
        "system.cpu.iowait.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.process.memory.size": {
          "type": "long"
        },
        "system.network.out.dropped": {
          "type": "long"
        },
        "cpu.status": {
          "type": "keyword"
        },
        "host.name": {
          "type": "text",
          "fields": {
            "keyword": {
              "ignore_above": 256,
              "type": "keyword"
            }
          }
        },
        "system.diskio.iostat.await": {
          "type": "float"
        },
        "system.network.out.packets": {
          "type": "long"
        },
        "system.cpu.steal.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.cpu.steal.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.diskio.write.count": {
          "type": "long"
        },
        "process.name": {
          "type": "text",
          "fields": {
            "keyword": {
              "ignore_above": 256,
              "type": "keyword"
            }
          }
        },
        "system.diskio.read.time": {
          "type": "long"
        },
        "system.diskio.serial_number": {
          "type": "keyword"
        },
        "system.fsstat.total_files": {
          "type": "long"
        },
        "system.network.in.packets": {
          "type": "long"
        },
        "system.cpu.total.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.network.out.errors": {
          "type": "long"
        },
        "system.diskio.iostat.write.request.merges_per_sec": {
          "type": "float"
        },
        "system.memory.swap.total": {
          "type": "long"
        },
        "system.diskio.io.time": {
          "type": "long"
        },
        "system.cpu.total.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.load.15": {
          "scaling_factor": 100,
          "type": "scaled_float"
        },
        "system.cpu.cores": {
          "type": "long"
        },
        "system.fsstat.status": {
          "type": "keyword"
        },
        "system.cpu.softirq.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.load.norm.5": {
          "scaling_factor": 100,
          "type": "scaled_float"
        },
        "system.diskio.iostat.write.request.per_sec": {
          "type": "float"
        },
        "system.diskio.read.bytes": {
          "type": "long"
        },
        "system.fsstat.total_size.used": {
          "type": "long"
        },
        "system.load.norm.1": {
          "scaling_factor": 100,
          "type": "scaled_float"
        },
        "system.process.cpu.start_time": {
          "type": "date"
        },
        "system.memory.swap.used.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.cpu.idle.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.diskio.iostat.read.request.per_sec": {
          "type": "float"
        },
        "system.network.out.bytes": {
          "type": "long"
        },
        "system.memory.swap.used.bytes": {
          "type": "long"
        },
        "process.args": {
          "type": "keyword"
        },
        "system.cpu.system.norm.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "system.process.cpu.total.pct": {
          "scaling_factor": 1000,
          "type": "scaled_float"
        },
        "metricset.name": {
          "type": "keyword"
        },
        "system.fsstat.total_size.total": {
          "type": "long"
        },
        "system.process.state": {
          "type": "keyword"
        }
      }
    }
  },
  "composed_of": [],
  "data_stream": {
    "hidden": false,
    "allow_custom_routing": false
  }
}

I've noticed in addition to datastream below is also getting created:


Yes that is called the Backing Index... you should read about Data Streams...

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