Hi,
I want to make a copy of a document. How can I do that?
My main interest is to create a index template similar to logstash-.*
So, I would like to copy the template into another duplicate template.
Can you please suggest how can I do this.
Hi,
I want to make a copy of a document. How can I do that?
My main interest is to create a index template similar to logstash-.*
So, I would like to copy the template into another duplicate template.
Can you please suggest how can I do this.
If you want to make a copy of the logstash template then you can the file elasticsearch-template.json from the logstash installation. Otherwise you need to use:
curl -XGET http://localhost:9200/_template/template_name > template.json
Edit template.json and remove the the second line which is "template_name: {" and the second last line which is "}".
Make any changes you want then add it with a new name:
curl -XPUT http://localhost:9200/_template/new_template_name -d @template.json
Thanks a ton @msimos . It worked.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.