GET DATA FROM PAYLOAD IN ILM WATCHER

Hi to all!!

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

{ "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

 {"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 ??

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