Return task id when submitting a POST request

Hello,
How do I return the TASK ID when submitting a POST request like:

POST _reindex?requests_per_second=115&wait_for_completion=true
{
  "source": {
    "index": "elb-2020.01.*",
    "size": 500
  },
  "dest": {
    "index": "elb-2020.01"
  },
  "script": {
    "lang": "painless",   
    "source": """
      ctx._source.index = ctx._index;
      def eventData = ctx._source["event.data"];
      if (eventData != null) {
        eventData.remove("realmDb.size");
        eventData.remove("realmDb.format");
        eventData.remove("realmDb.contents");
      }
    """
  }
}

i am basically writing a bash script and want to check to see if the task has been completed before proceeding.

any advice is much appreciated

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