# Removing persistent cluster settings

**URL:** <https://discuss.elastic.co/t/removing-persistent-cluster-settings/372341>\
**Category:** Elasticsearch\
**Created:** [December 23, 2024, 9:40pm UTC](https://discuss.elastic.co/t/removing-persistent-cluster-settings/372341 "2024-12-23T21:40:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [December 23, 2024, 9:40pm UTC](https://discuss.elastic.co/t/removing-persistent-cluster-settings/372341/1 "2024-12-23T21:40:59Z")

</div>

Hi All,

I applied the following in my test environment through Dev tools:

```auto
PUT /_cluster/settings
    {
      "persistent": {
        "xpack.notification.email.account.exchange_account": {
            "profile": "outlook",
            "email_defaults": {
              "from": "hello.world@abc.com"
            },
            "smtp": {
                "auth": false,
                "starttls.enable": false,
                "host": "abc.def.net",
                "port": 25
            }
        }
      }
    }

```

I need to remove these settings now.

Please guide on how this could be done.

My entire cluster settings are as follows:

```auto
{
  "persistent": {
    "cluster": {
      "max_shards_per_node": "5000"
    },
    "search": {
      "max_async_search_response_size": "50mb"
    },
    "xpack": {
      "monitoring": {
        "collection": {
          "enabled": "true"
        }
      },
            "notification": {
        "email": {
          "account": {
            "exchange_account": {
              "email_defaults": {
                "from": "hello.world@abc.com"
              },
              "profile": "outlook",
              "smtp": {
                "host": "abc.def.net",
                "starttls": {
                  "enable": "false"
                },
                "auth": "false",
                "port": "25"
              }
            }
          }
        }
      }
    }
  },
  "transient": {}

```

Thanks

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [December 23, 2024, 10:00pm UTC](https://discuss.elastic.co/t/removing-persistent-cluster-settings/372341/2 "2024-12-23T22:00:00Z")

</div>

Just set the setting as `null` as shown in the example in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html#cluster-update-settings-api-desc)

In this case it would be something like this:

```auto
PUT /_cluster/settings
{
  "persistent": {
    "xpack.notification.email.account.exchange_account": null
  }
}

```

---

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [December 23, 2024, 10:03pm UTC](https://discuss.elastic.co/t/removing-persistent-cluster-settings/372341/3 "2024-12-23T22:03:10Z")

</div>

Thanks. I get the following:

```auto
#! [xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release.
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "persistent setting [xpack.notification.email.account.exchange_account], not recognized"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "persistent setting [xpack.notification.email.account.exchange_account], not recognized"
  },
  "status": 400
}

```

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [December 23, 2024, 10:20pm UTC](https://discuss.elastic.co/t/removing-persistent-cluster-settings/372341/4 "2024-12-23T22:20:10Z")

</div>

Yeah, not sure.

Maybe you need to set it on the parent level, `xpack.notification.email.account`.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [December 24, 2024, 9:11am UTC](https://discuss.elastic.co/t/removing-persistent-cluster-settings/372341/5 "2024-12-24T09:11:02Z")

</div>

You either need to set each individual setting to `null` like this:

```plaintext
PUT /_cluster/settings
{
  "persistent": {
    "xpack": {
      "monitoring": {
        "collection": {
          "enabled": null
        }
      },
      "notification": {
        "email": {
          "account": {
            "exchange_account": {
              "email_defaults": {
                "from": null
              },
              "profile": null,
              "smtp": {
                "host": null,
                "starttls": {
                  "enable": null
                },
                "auth": null,
                "port": null
              }
            }
          }
        }
      }
    }
  }
}

```

Or else you can use wildcards:

```plaintext
PUT /_cluster/settings
{
  "persistent": {
    "xpack.notification.email.account.exchange_account.*": null
  }
}

```

---

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [December 24, 2024, 2:14pm UTC](https://discuss.elastic.co/t/removing-persistent-cluster-settings/372341/6 "2024-12-24T14:14:34Z")

</div>

> [@DavidTurner](#):
>
> ```auto
> PUT /_cluster/settings
> {
> "persistent": {
> "xpack.notification.email.account.exchange_account.*": null
> }
> }
> 
> ```

Thanks! That worked.
