No matching index template found for data streamd

Hello, i am trying to run metricbeat setup command to create datastream but i am getting an error

./metricbeat setup --index-management -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["https://${ES_URL}"]' -E 'output.elasticsearch.ssl.certificate_authorities=[${CA_CERT}]' -E 'setup.template.pattern="metricbeat-8.*"' -E 'setup.template.name="metricbeat"'
Overwriting ILM policy is disabled. Set `setup.ilm.overwrite: true` for enabling.

Exiting: error loading template: failed to put data stream: could not put data stream: 400 Bad Request: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no matching index template found for data stream [metricbeat]"}],"type":"illegal_argument_exception","reason":"no matching index template found for data stream [metricbeat]"},"status":400}. Response body: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no matching index template found for data stream [metricbeat]"}],"type":"illegal_argument_exception","reason":"no matching index template found for data stream [metricbeat]"},"status":400}

Any ideas how can i specify custom template and pattern without getting this error?
Also i tired as this doc suggested Change the index name | Metricbeat Reference [8.2] | Elastic

To change datastream name but still getting the same error

After fighting a lot with index templates auto-load and setups:

Disable all the auto-setup.

setup.template.enabled: false

Export the JSON configuration:

./metricbeat export template > metricbeat.template.json

Copy the content of the file and go to the Kibana Console:

PUT /_index_template/the_name_for_your_template
{
/* The content of metricbeat.template.json */
/* Customize everything you want, like number of shards or ILM policy, or pattern */
}

For more friendly tweaks go to Kibana => Stack Mangement => Index Templates and make the changes you need when debuging the indexing.

This is the most handy method, for my point of view.

I tried with export but json is too big to store it in config map. I am executing metricbeat setup using kubernetes job when i am running helm install. And as output i am using logstash and not elasticsearch that's why i need separate job which will have elasticsearch output to setup template

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