---
type: api
title: Get cluster-wide settings
description: By default, it returns only settings that have been explicitly defined.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-cluster-get-settings
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-cluster-get-settings
products:
  - Elasticsearch
---

# Get cluster-wide settings

Availability:

## Paths

- `GET` `/_cluster/settings`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#bearerauth)

## Description

By default, it returns only settings that have been explicitly defined.

## Required authorization

* Cluster privileges: `monitor`

[More about Elastic Stack settings](https://www.elastic.co/docs/deploy-manage/stack-settings)

## Query String Parameters

- `flat_settings` (boolean · default: false)
  If `true`, returns settings in flat format.
- `include_defaults` (boolean · default: false)
  If `true`, also returns the values of all other cluster settings set in the
`elasticsearch.yml` file on one of the nodes in your cluster, together with the default
values of all other cluster settings on that node. The default value of each setting may
depend on the values of other settings on that node. If the nodes in your cluster do not all
have the same configuration then the values returned by this API may vary from invocation to
invocation and may not reflect the values that Elasticsearch uses in all situations. Use the
`GET _nodes/settings` API to fetch the settings for each individual node in your cluster.
- `master_timeout` (string Duration · default: 30s)
  Period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error.
- `timeout` (string Duration · default: 30s)
  Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.

## Response

`application/json`

- `persistent` (map string to object)
  The settings that persist after the cluster restarts.
- `transient` (map string to object)
  The settings that do not persist after the cluster restarts.
- `defaults` (map string to object)
  The default setting values.
## Code Examples

#### Console

```console
GET /_cluster/settings?filter_path=persistent.cluster.remote
```

#### JavaScript

```javascript
const response = await client.cluster.getSettings({
  filter_path: "persistent.cluster.remote",
});
```

#### Python

```python
resp = client.cluster.get_settings(
    filter_path="persistent.cluster.remote",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_cluster/settings?filter_path=persistent.cluster.remote" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.cluster().getSettings(g -> g);
```

#### C#

```c#
var response = await client.Cluster.GetSettingsAsync();
```

#### PHP

```php
$resp = $client->cluster()->getSettings([
    "filter_path" => "persistent.cluster.remote",
]);
```

#### Ruby

```ruby
response = client.cluster.get_settings(
  filter_path: "persistent.cluster.remote"
)
```

