Kibana version: 7.6.0
Describe the bug:
Relative URLs keep parsedUrl / origin generated at the time of the creation of the index-pattern.
Steps to reproduce:
On a Kibana instance located at https://localhost:5601:
index-pattern settingstext field to be formatted as Url and specify a relative URL (e.g. /some/file.png).kibana* indiceshttps://dev.comp.com:5601 (server.host: dev.comp.com in kibana.yml):.kibana* indiceshttps://localhost:5601Expected behavior:
The "base" URL should not be stored in the index-pattern.
Provide logs and/or server output (if relevant):
GET .kibana/_doc/index-pattern:90943e30-9a47-11e8-b64d-95841ca0b247?filter_path=_source.index-pattern.fieldFormatMap
# Response
{
"_source" : {
"index-pattern" : {
"fieldFormatMap" : """{"url.keyword":{"id":"url","params":{"parsedUrl":{"origin":"https://localhost:5601","pathname":"/app/kibana","basePath":""},"urlTemplate":"/some/param.png"}},"url":{"id":"url","params":{"parsedUrl":{"origin":"https://localhost:5601","pathname":"/app/kibana","basePath":""},"urlTemplate":"/some/param.png"}}}"""
}
}
}
Any additional context:
From our Discuss forum https://discuss.elastic.co/t/kibana-url-template-with-relative-path/228418/5
Workaround:
One of the following applies:
1) Patch the Kibana object by import / export
2) Patch the Kibana index-pattern object in the .kibana index
3) Edit the index-pattern, switch to the default type, save, then add the Url type back
Pinging @elastic/kibana-app-arch (Team:AppArch)
There is a similar problem when importing saved objects: all the URLs will use the name of the old instance.
(I'm using kibana 7.6.1)
Briefly looked at this; instantiating a new field formats service will use the current value from window.location for the parsedUrl fields, but when reading a format from a saved object we will just use whatever values are stored there.
How we want to address this will need further discussion -- I'm actually not clear why we _need_ to store the parsedUrl.origin in the first place when it seems to me the desired behavior would always be to include the current origin, and just have the stored path & template.
Any way to prioritize a fix for this? We have 12 clusters and Kibana objects have to be kept in sync across each of them. This bug is a major pain point right now.