Home > Net >  Renaming Elastic Search index with Apache Nifi
Renaming Elastic Search index with Apache Nifi

Time:06-14

How can I rename an Elastic Search index with apache Nifi? Which processor do I need to use for renaming or updating an index?

CodePudding user response:

They arenot commands to change an index name.

There are 3 solutions:

  1. You can do it by using reindex api (he will reindex all your data from an index to another one, dont forget to set back your mappings first. https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

  2. Similar to 1, using snapshot. https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshot-restore.html

  3. Not a real index change. You can "overwrite" the index name with alias. https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html

1 and 3 are really simple, and could be done with simple CURL or using HEAD plugin (chrome) or in a kibana console.

ps: i assume you are able to send a http command (but i am pretty sure some tools exist in apache nifi => processor PostHttp)

CodePudding user response:

I have found a solution and done the purpose. I have used a PostHTTP processor for requests and used a flow file for generating the JSON body. Basically, we have to run direct HTTP requests or CURL commands for updating the index.

We also can do this by using other processors named ExecuteProcess, ExecuteScript, or ExecuteStreamCommand for executing CURL scripts.

  • Related