# GET DATA FROM PAYLOAD IN ILM WATCHER

**URL:** <https://discuss.elastic.co/t/get-data-from-payload-in-ilm-watcher/326680>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [February 28, 2023, 11:41am UTC](https://discuss.elastic.co/t/get-data-from-payload-in-ilm-watcher/326680 "2023-02-28T11:41:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lopez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_lopez/32/50639_2.png) [@Daniel\_Lopez](https://discuss.elastic.co/u/Daniel_Lopez)\
**Post date:** [February 28, 2023, 11:41am UTC](https://discuss.elastic.co/t/get-data-from-payload-in-ilm-watcher/326680/1 "2023-02-28T11:41:45Z")

</div>

Hi to all!!

I'm trying to get the index with ILM errors, so i created a watcher like this:

```auto
{ "trigger": { "schedule": { "interval": "10m" } }, "input": { "http": { "request": { "scheme": "https", "host": "$host", "port": 9200, "method": "get", "path": "*/_ilm/explain", "params": {"only_errors":""}, "headers": { "Authorization": "ApiKey xxxxx==" } } } }, "condition": { "always": {} }, "actions": { "test_log": { "logging": { "level": "warn", "text": "ILM Failed: {{#ctx.payload.indices}}{{index}},{{reason}}{{/ctx.payload.indices}}" } } } }

```

But I'm getting empty results

Payload is like this

```auto
 {"result": {
    "execution_time": "2023-02-28T07:50:21.496Z",
    "execution_duration": 32,
    "input": {
      "type": "http",
      "status": "success",
      "payload": {
         "indices": {
          "indice1": {
            "index": "indice1",
            "managed": true,
            "policy": "1day",
            "lifecycle_date_millis": 1654884053459,
            "age": "262.57d",
            "phase": "hot",
            "phase_time_millis": 1677569969548,
            "action": "rollover",
            "action_time_millis": 1673690521818,
            "step": "ERROR",
            "step_time_millis": 1677570569531,
            "failed_step": "check-rollover-ready",
            "is_auto_retryable_error": true,
            "failed_step_retry_count": 3229,
            "step_info": {
              "type": "illegal_argument_exception",
              "reason": "setting [index.lifecycle.rollover_alias] for index [indice1] is empty or not defined",
              "stack_trace": "java.lang.IllegalArgumentException: setting [index.lifecycle.rollover_alias] for index [indice1] is empty or not defined\n"
            },
            "phase_execution": {
              "policy": "1day",
              "phase_definition": {
                "min_age": "0ms",
                "actions": {
                  "rollover": {
                    "max_primary_shard_size": "40gb",
                    "max_age": "30d"
                  },
                  "set_priority": {
                    "priority": 100
                  }
                }
              },
              "version": 1,
              "modified_date_in_millis": 1665062979533
            }
          },
          "indice2": {
            "index": "indice2",
            "managed": true,
            "policy": "day1",
            "lifecycle_date_millis": 1667404332842,
            "age": "117.66d",
            "phase": "hot",
            "phase_time_millis": 1677570568330,
            "action": "rollover",
            "action_time_millis": 1667404334706,
            "step": "ERROR",
            "step_time_millis": 1677570573533,
            "failed_step": "update-rollover-lifecycle-date",
            "is_auto_retryable_error": true,
            "failed_step_retry_count": 6463,
            "step_info": {
              "type": "illegal_state_exception",
              "reason": "no rollover info found for [indice2] with rollover target [ccccc], the index has not yet rolled over with that target",
              "stack_trace": "java.lang.IllegalStateException: no rollover info found for [indice2] with rollover target [cccc], the index has not yet rolled over with that target\n"
            },
            "phase_execution": {
              "policy": "day1",
              "phase_definition": {
                "min_age": "0ms",
                "actions": {
                  "rollover": {
                    "max_primary_shard_size": "40gb",
                    "max_age": "30d"
                  },
                  "set_priority": {
                    "priority": 100
                  }
                }
              },
              "version": 1,
              "modified_date_in_millis": 1665063041858
            }
          
          }}}}}}

```

Could some help me to get at least the fields index and reason ??

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 28, 2023, 11:42am UTC](https://discuss.elastic.co/t/get-data-from-payload-in-ilm-watcher/326680/2 "2023-03-28T11:42:38Z")

</div>

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