# Kibana URL template with relative path

**URL:** <https://discuss.elastic.co/t/kibana-url-template-with-relative-path/228418>\
**Category:** Kibana\
**Created:** [April 16, 2020, 11:17pm UTC](https://discuss.elastic.co/t/kibana-url-template-with-relative-path/228418 "2020-04-16T23:17:07Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)\
**Post date:** [April 18, 2020, 12:51pm UTC](https://discuss.elastic.co/t/kibana-url-template-with-relative-path/228418/10 "2020-04-18T12:51:53Z")

</div>

One possible workaround might be:

1. Get the `index-pattern` using its title or the ID

```auto
# Search by index-pattern title
GET .kibana/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "type": {
              "value": "index-pattern"
            }
          }
        },
        {
          "term": {
            "index-pattern.title": {
              "value": "kibana_sample_data_logs"
            }
          }
        }
      ]
    }
  }
}
# Or if you know the ID
GET .kibana/_doc/index-pattern:90943e30-9a47-11e8-b64d-95841ca0b247

```

1. Get the content of the field `fieldFormatMap`.  
E.g.

2. Get the `_id` of the `index-pattern`.  
E.g. `index-pattern:90943e30-9a47-11e8-b64d-95841ca0b247`

3. Modify the content of the `fieldFormatMap` to replace the URL of your local environment with the correct one

4. Execute a partial update.  
E.g.

```auto
POST .kibana/_update/index-pattern:90943e30-9a47-11e8-b64d-95841ca0b247
{
  "doc": {
    "index-pattern": {
      "fieldFormatMap": """{"url.keyword":{"id":"url","params":{"parsedUrl":{"origin":"https://yourdevenv:5601","pathname":"/app/kibana","basePath":""},"urlTemplate":"/some/pathname/asset.png"}},"url":{"id":"url","params":{"parsedUrl":{"origin":"yourdevenv:5601","pathname":"/app/kibana","basePath":""},"urlTemplate":"/some/pathname/asset.png"}}}"""
    }
  }
}

```

All those requests can be done using `bash`, `curl` and `sed` and automated in a script.

I've opened the following for reference:

> <https://github.com/elastic/kibana/issues/63924>
>
> 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...

---

_[View the full topic](https://discuss.elastic.co/t/kibana-url-template-with-relative-path/228418)._
