# REST API to access/update Advanced Settings

**URL:** <https://discuss.elastic.co/t/rest-api-to-access-update-advanced-settings/220350>\
**Category:** Kibana\
**Created:** [February 21, 2020, 12:20pm UTC](https://discuss.elastic.co/t/rest-api-to-access-update-advanced-settings/220350 "2020-02-21T12:20:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gab.bernasconi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gab.bernasconi/32/57955_2.png) [@gab.bernasconi](https://discuss.elastic.co/u/gab.bernasconi)\
**Post date:** [February 21, 2020, 12:20pm UTC](https://discuss.elastic.co/t/rest-api-to-access-update-advanced-settings/220350/1 "2020-02-21T12:20:12Z")

</div>

I am currently using Kibana version 7.4.2 Saved Objects REST API (see [here](https://www.elastic.co/guide/en/kibana/7.4/saved-objects-api.html)) to programmatically customize some Kibana Advanced Settings.

In particular, I am customizing the `dateFormat:tz` setting to choose the timezone Kibana uses to localize data, as the default value `Browser` is not appropriate for our use case.

The problem is that if I try to set an invalid value like `INVALID_TIMEZONE_NAME`, I don't get any error, and I can't find a way to programmatically check if the setting was correctly applied.

In particular, if I do the following:

```auto
PUT /api/saved_objects/config/7.4.2
{
  "attributes": {
    "dateFormat:tz": "INVALID_TIMEZONE_NAME"
  }
}

```

I get the following VALID answer (http status 200):

```auto
{
  "id":"7.4.2",
  "type":"config",
  "updated_at":"2020-02-21T12:01:34.908Z",
  "version":"WzkzMSwxXQ==",
  "attributes": {
    "dateFormat:tz": "INVALID_TIMEZONE_NAME"
  }
}

```

If I check the Advanced Settings from the Kibana GUI, I see that the timezone has been set to the default value of `Browser`. But if I call `GET api/saved_objects/config/7.4.2`, I get the following result:

```auto
{
  "id":"7.4.2",
  "type":"config",
  "updated_at":"2020-02-21T12:01:34.908Z",
  "version":"WzkzMSwxXQ==",
  "attributes": {
    "buildNum": 26506,
    "dateFormat:tz": "INVALID_TIMEZONE_NAME"
  },
  "references":[]
}

```

To summarize, the problems are:

- I don't get an error if I try to set an invalid value for `dateFormat:tz` (I would expect an http status of 400), so it looks like there's no validation of the passed timezone value
- I cannot cross-check the value I passed with the current value, as the REST API still returns the incorrect value, while the Kibana GUI shows the default value `Browser`

Is there any way to validate the value I passed to Kibana?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [February 24, 2020, 6:34pm UTC](https://discuss.elastic.co/t/rest-api-to-access-update-advanced-settings/220350/2 "2020-02-24T18:34:07Z")

</div>

Hi, this sounds like a bug in Kibana. I would guess the GUI shows `Browser` as the selected option because it can't select the value in the data so it defaults to Browser.

Would you be willing to file an issue about this bug? [https://github.com/elastic/kibana/issues/new/choose](https://github.com/elastic/kibana/issues/new/choose)

---

<div class="post-metadata">

**Author:** ![gab.bernasconi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gab.bernasconi/32/57955_2.png) [@gab.bernasconi](https://discuss.elastic.co/u/gab.bernasconi)\
**Post date:** [February 25, 2020, 8:58am UTC](https://discuss.elastic.co/t/rest-api-to-access-update-advanced-settings/220350/3 "2020-02-25T08:58:13Z")

</div>

Hi @tsullivan, thanks for the quick answer.

> [@tsullivan](#):
>
> Would you be willing to file an issue about this bug?

I just filed a bug about this, see [Missing validation for "dateFormat:tz" setting via Saved Objects REST API · Issue #58437 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/58437)

---

<div class="post-metadata">

**Author:** ![gab.bernasconi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gab.bernasconi/32/57955_2.png) [@gab.bernasconi](https://discuss.elastic.co/u/gab.bernasconi)\
**Post date:** [March 4, 2020, 2:01pm UTC](https://discuss.elastic.co/t/rest-api-to-access-update-advanced-settings/220350/4 "2020-03-04T14:01:53Z")

</div>

Hello again @tsullivan, sorry to come back on this, but I got an idea while working on the feature in my project.

Right now Kibana offers basically 2 choices for the `dateFormat:tz` setting: either the client (i.e. `Browser`) time zone, or a specific time zone chosen from an explicit list (e.g. `America/New_York`).

Why not add also the `Server` choice? The Kibana server is surely running in an environment with a configured time zone, be it a virtual machine, a bare metal machine, or a Docker container; if I could choose to localize data in the server time zone, I could just configure the server time zone accordingly (as I already do for other components of my project), and the data would be localized in THAT time zone. If that changes, I would not have to change the Kibana setting, as it would already be set to `Server`.

Do you think this might make sense as a feature request? It would make sense in my use case, but do you think it might be useful also to others?

---

<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:** [April 1, 2020, 2:01pm UTC](https://discuss.elastic.co/t/rest-api-to-access-update-advanced-settings/220350/5 "2020-04-01T14:01:55Z")

</div>

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