Home > Blockchain >  Logstash-OpenSearch: index is not created from provided template file
Logstash-OpenSearch: index is not created from provided template file

Time:08-19

Due to AWS migration I have to migrate from ElasticSearch to OpenSearch. I am using Logstash to populate index with the DB data. In the existing Logstash's enter image description here enter image description here

As a result the index documents created using auto-mapping do not correspond the required structure. I tried to create a template manually before starting the Logstash. In that case documents looks good. But I do want the Logstash to create the template and index.

Question: Can anyone tell me how to solve this?

UPDATED: As per enter image description here

CodePudding user response:

The first screenshot you get from _cat/templates shows that the template exists.

The template is still a legacy template stored via the _template API and not the new _index_template API.

So if you run the following, you should find your template:

GET http://localhost:9200/_template/cas-template

Now as to why the index is created with a default automatic template and not the one that was just installed, it's because you're using the new composable template format with the old legacy template endpoint. Make sure that your /usr/share/logstash/pipeline/template/cas-template.json file contains the legacy format and not the composable one. The notable difference is that in the new format everything is wrapped in a section called template: {}

  • Related