# Link in Markdown panel to dashboard with specific time and refresh interval?

**URL:** <https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985>\
**Category:** Kibana\
**Created:** [June 4, 2021, 1:27pm UTC](https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985 "2021-06-04T13:27:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)\
**Post date:** [June 4, 2021, 1:27pm UTC](https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985/1 "2021-06-04T13:27:35Z")

</div>

I'm using TSVB Markdown panels to present links to dashboards, like this:

```markdown
[Dashboard title](#/dashboard/88da11e0-9c58-11eb-b38d-7b8e5ab9c930)

```

Such links are independent of the current space, which is how I like them. They link to the dashboard with that ID in whatever the current space happens to be. I do _not_ want to cite a specific space in the URL. One reason: I copy the set of saved objects from my "dev" space to my "demo" space. When I view this Markdown in the dev space, I want to link to the dashboard in the dev space; in the demo space, I want to link to the dashboard in the demo space.

**(How) can I present a link that goes to a dashboard and sets its time range and refresh interval?** For example, as specified by the following query string:

```auto
?_g=(refreshInterval:(pause:!f,value:30000),time:(from:now-10m,to:now))

```

I've tried numerous URLs without success.

I don't particularly want to create a copy of this dashboard, and save it with time settings, simply to achieve this.

**Closely related question:** suppose I have a space, `myspace`, for which I have defined the following `defaultRoute` setting (to a "home" dashboard):

`/app/dashboards#/view/d24954f0-a7e6-11eb-b38d-7b8e5ab9c930`

To go to that home dashboard, I use the following URL:

```auto
http://elastichost.example.com:15601/s/myspace

```

(How) can I specify a query string in that URL that sets the time and refresh interval?

Simply appending a query string to that `s/myspace` URL does not work.

In practice, I need to cite the URL with the full dashboard ID:

```auto
http://elastichost.example.com:15601/s/myspace/app/dashboards#/view/d24954f0-a7e6-11eb-b38d-7b8e5ab9c930?_g=(refreshInterval:(pause:!f,value:30000),time:(from:now-10m,to:now))

```

That works, but I'm wistful about a URL without that long ID.

---

<div class="post-metadata">

**Author:** ![devon.thomson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devon.thomson/32/85468_2.png) [@devon.thomson](https://discuss.elastic.co/u/devon.thomson)\
**Post date:** [June 8, 2021, 7:59pm UTC](https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985/2 "2021-06-08T19:59:11Z")

</div>

Great questions Graham. For the first question, it looks like you're using a fairly old URL format which may not be properly persisting state through the redirect. To fix this, you should replace markdown links in the format `#dashboard/{id}` with `#view/{id}`. I was able to get the time range state to apply on the destination dashboard with `[Dashboard Title](#/view/edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b?_g=(refreshInterval:(pause:!f,value:30000),time:(from:now-10m,to:now)))`

The second question is a bit more complex, and honestly sounds like more of a feature request. I can ask around though, to see if there is any way to get URL state from the default route.

---

<div class="post-metadata">

**Author:** ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)\
**Post date:** [July 1, 2021, 4:56am UTC](https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985/3 "2021-07-01T04:56:15Z")

</div>

Hi @devon.thomson ,

Thank you so much for your very helpful reply, and sincere apologies for this belated acknowledgment.

> [@devon.thomson](#):
>
> To fix this, you should replace markdown links in the format `#dashboard/{id}` with `#view/{id}` .

👍

Done. Works. And, yes, with that new URL path, the URL query string (for example, to set the time range) now works.

I forget where I first got that `#dashboard/{id}` URL from.

Can you point me to a topic in the Kibana docs that shows that `#view/{id}` URL format (ideally, but not necessarily, in the context of a Markdown panel)?

Since I was unknowingly using an old URL format for those links in Markdown, I thought it was worth asking: am I using the correct URL format in my `defaultRoute` setting:

```auto
/app/dashboards#/view/d24954f0-a7e6-11eb-b38d-7b8e5ab9c93a

```

Is `/app/dashboards#/view/{id}` correct in this context, or should I be using some other format?

---

<div class="post-metadata">

**Author:** ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)\
**Post date:** [July 2, 2021, 2:05am UTC](https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985/4 "2021-07-02T02:05:19Z")

</div>

> [@devon.thomson](#):
>
> I can ask around though, to see if there is any way to get URL state from the default route.

After re-reading your reply—in particular, the phrase "get URL state from the default route"—I thought I should clarify what I meant, because I suspect I wasn't clear enough in my original post (sorry).

Given the following `defaultRoute` value for the KIbana space `myspace`:

`/app/dashboards#/view/d24954f0-a7e6-11eb-b38d-7b8e5ab9c939`

in my web browser, I'd like to specify the following URL (that is, with a query string for the time range and refresh interval):

`http://myelastichost:5601/s/myspace?_g=(refreshInterval:(pause:!f,value:30000),time:(from:now-10m,to:now))`

Kibana (7.11.2) ignores that query string; it replaces that query string with the query-string-format equivalents of the `timepicker:timeDefaults` and `timepicker:refreshIntervalDefaults` settings.

So, from my (admittedly, perhaps idiosyncratic) perspective, and with apologies if you think I'm splitting hairs, I don't want to "get URL state [e.g. time] from the default route", because I don't want to _store_ that state in the `defaultRoute` setting. Rather, if a browser sends a request that matches the (query-string-less) `defaultRoute` URL, then I'd like Kibana to honor any query string specified with that request.

What do you think? Should I create a feature request issue in GitHub for this, or is this—the fact that Kibana ignores such query strings—a bug?

---

<div class="post-metadata">

**Author:** ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)\
**Post date:** [July 2, 2021, 2:44am UTC](https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985/5 "2021-07-02T02:44:11Z")

</div>

Here's my specific use case for wanting Kibana to honor query strings specified with the default route.

I'm about to publish a Docker image, based on the "all-in-one Elastic Stack" `sebp/elk` image, that includes sample data with dashboards. The container startup script imports the included Kibana saved objects and uses Logstash to ingest the included JSON Lines data. This works.

In the Docker image documentation, I want to provide a Kibana URL with a query string that specifies the absolute time range of the included sample data. So that user don't have to "hunt around" for that sample data: they can immediately start exploring the precise time range covered by that data.

I want that URL to consist of the default route with a query string.

I'd prefer _not_ to:

- Specify a URL that cites a view ID (long, inelegant)
- Specify that time as the `timepicker:timeDefaults` setting value (while one use case for this Docker image is to view the sample data, another is to ingest the user's own data; in which case, the time range of the sample data would be an annoying and inappropriate default)

An option that I've used in the past in similar circumstances is to refer to the Kibana UI's own list of dashboards. For example:

```auto
http://myelastichost:5601/s/myspace/app/dashboards#/list?_g=(refreshInterval:(pause:!f,value:30000),time:(from:now-10m,to:now))

```

That works, in the sense that it avoids specifying a view ID in the URL, and when the user clicks a dashboard in the list, the time values in the query string are honored. But I want to do better: I want to point the user at the ("friendlier") "home" dashboard that I've developed as the intended entry point to this set of dashboards.

Perhaps I should just get over my squeamishness about specifying a view ID in the URL that I cite in the Docker image documentation. I can't just "hide" the URL-with-view-ID behind nicer-looking link text; I have to cite a URL. Because the hostname, port, and, potentially, space (I've made this user-definable via an environment variable) are not fixed: they depend on the user's specific environment. I typically tend to avoid presenting actual URLs in documentation, in favor of hyperlinks with link text. But in some cases, such as this one, it's unavoidable. Because I'm presenting a _URL pattern with placeholders_, rather than an _actual URL_.

Perhaps it's (past?) time I should start a new topic (or GitHub issue?) for this particular (sub-?)topic ("honoring query strings specified by requests that match the default route")?

---

<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:** [July 30, 2021, 2:44am UTC](https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985/6 "2021-07-30T02:44:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![devon.thomson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devon.thomson/32/85468_2.png) [@devon.thomson](https://discuss.elastic.co/u/devon.thomson)\
**Post date:** [August 9, 2021, 2:55pm UTC](https://discuss.elastic.co/t/link-in-markdown-panel-to-dashboard-with-specific-time-and-refresh-interval/274985/7 "2021-08-09T14:55:05Z")

</div>

Hi Graham! Sorry for the late reply, but yes it honestly sounds like a bug that Kibana doesn't honour the query string when entering a dashboard through the default route. If you haven't done so already, I would create an issue. This may not be related specifically to the dashboard plugin (my area of expertise), but ping me in the issue and I can assign it to the Kibana Presentation team, and we can do a little bit of research.

In the meantime, I'm afraid I don't have any suggestions for a workaround, other than using the listing page, or providing a URL pattern in your documentation.
