I am currently using Kibana version 7.4.2 Saved Objects REST API (see here) 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:
PUT /api/saved_objects/config/7.4.2
{
"attributes": {
"dateFormat:tz": "INVALID_TIMEZONE_NAME"
}
}
I get the following VALID answer (http status 200):
{
"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:
{
"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?