# Landing on a dashboard with a dynamic time period

**URL:** https://discuss.elastic.co/t/landing-on-a-dashboard-with-a-dynamic-time-period/122958
**Category:** Kibana
**Created:** [March 7, 2018, 8:25pm UTC](https://discuss.elastic.co/t/landing-on-a-dashboard-with-a-dynamic-time-period/122958 "2018-03-07T20:25:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mr\_chang7](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mr\_chang7](https://discuss.elastic.co/u/mr_chang7)
#### Post date: [March 7, 2018, 8:25pm UTC](https://discuss.elastic.co/t/landing-on-a-dashboard-with-a-dynamic-time-period/122958/1 "2018-03-07T20:25:21Z")

</div>

Hello guys,

I made a scripted field, say 'A', with setting an URL template to land on a dashboard. But I'd like set the time period on the landed dashboard based on a timestamp field in the original event having the field 'A'. Specifically, I'd like to set the time period nearby the specific timestamp (e.g., +/- 10 seconds).

Is there any possible way to do it using kibana or other functionalities?

I tried and searched for any clues to this with nothing. Hope I could get some help from here.

Cheers!  
-ray

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [March 7, 2018, 9:55pm UTC](https://discuss.elastic.co/t/landing-on-a-dashboard-with-a-dynamic-time-period/122958/2 "2018-03-07T21:55:47Z")

</div>

hi @mr_chang7,

the URL-formats are not documented, but you can use the `time:` property.

e.g.:

this url points to a dashboard with time between 2013-03-08T00:00:00.000Z' and '2018-03-07T21:54:43.686Z'. You can adjust the `from` `to` param as desired.

`https://mykibana:9243/app/kibana#/dashboard/e8bdb540-ffc0-11e7-ac81-f372b1c72ba1?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:'2013-03-08T00:00:00.000Z',mode:absolute,to:'2018-03-07T21:54:43.686Z'))&_a=(description:'',filters:!(),fullScreenMode:!f,options:(darkTheme:!f,hidePanelTitles:!f,useMargins:!t),panels:!((gridData:(h:3,i:'1',w:6,x:0,y:0),id:ced24560-ffc0-11e7-ac81-f372b1c72ba1,panelIndex:'1',type:visualization,version:'6.1.1')),query:(language:lucene,query:''),timeRestore:!f,title:'1%20New%20Dashboard',viewMode:view)`

---

<div class="post-metadata">

### Author: ![mr\_chang7](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mr\_chang7](https://discuss.elastic.co/u/mr_chang7)
#### Post date: [March 7, 2018, 10:12pm UTC](https://discuss.elastic.co/t/landing-on-a-dashboard-with-a-dynamic-time-period/122958/3 "2018-03-07T22:12:49Z")

</div>

Right, that's the sort of URL I'm dealing with. I'd like to adjust the from/to part based on my timestamp field. Wondering if this is only possible when I make a scripted field on the timestamp field as I have to provide the {{value}} to the URL? Can I do that on the field "A" while using the timestamp adjustment?

One side question: the URL opens a dashboard on a new tab. How can I open it on the same tab?

Thanks for your help.

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [March 7, 2018, 10:16pm UTC](https://discuss.elastic.co/t/landing-on-a-dashboard-with-a-dynamic-time-period/122958/4 "2018-03-07T22:16:35Z")

</div>

you can access doc-values in your scripted field doing something doc['timestamp'].value.

This is a good intro: [https://www.elastic.co/blog/using-painless-kibana-scripted-fields](https://www.elastic.co/blog/using-painless-kibana-scripted-fields). It has some date examples.

---

<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 4, 2018, 10:17pm UTC](https://discuss.elastic.co/t/landing-on-a-dashboard-with-a-dynamic-time-period/122958/5 "2018-04-04T22:17:09Z")

</div>

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