# Generating a url that contains a query

**URL:** <https://discuss.elastic.co/t/generating-a-url-that-contains-a-query/159134>\
**Category:** Kibana\
**Created:** [December 3, 2018, 9:56am UTC](https://discuss.elastic.co/t/generating-a-url-that-contains-a-query/159134 "2018-12-03T09:56:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dafna\_Frank](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@Dafna\_Frank](https://discuss.elastic.co/u/Dafna_Frank)\
**Post date:** [December 3, 2018, 9:56am UTC](https://discuss.elastic.co/t/generating-a-url-that-contains-a-query/159134/1 "2018-12-03T09:56:10Z")

</div>

Hi, I would like to automatically create a url and pass to my users so they could see the results of the query from Kibana.

The query needs to contains something similar to this:  
{  
"query": {  
"match": {  
"kubernetes.pod\_name.keyword": {  
"query": "my\_pod\_name",  
"type": "phrase"  
}  
}  
}  
}

"my\_pod\_name" is dynamically created.

I've tried to create a filter but the url looks nothing like the query and contains guids and auto generated values which I do not understand how I can get them.

Is it a simple get command or should it be a post command?

How to I crate and pass such url to users?  
Thanks

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [December 4, 2018, 12:55am UTC](https://discuss.elastic.co/t/generating-a-url-that-contains-a-query/159134/2 "2018-12-04T00:55:38Z")

</div>

Unfortunately, there isn't a great to accomplish this now as our URL's are [RISON](https://github.com/Nanonid/rison) encoded, which is not friendly. There is work being done that will improve this in the future, though.

You're best bet is to create a filter on Discover which includes the Pod Name, and replace that value with your dynamic one.

For example: `http://localhost:5601/app/kibana#/discover?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-7d,mode:quick,to:now))&_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:d3d7af60-4c81-11e8-b3d7-01146121b73d,key:Carrier,negate:!f,params:(query:JetBeats,type:phrase),type:phrase,value:JetBeats),query:(match:(Carrier:(query:JetBeats,type:phrase))))),index:d3d7af60-4c81-11e8-b3d7-01146121b73d,interval:auto,query:(language:lucene,query:''),sort:!(timestamp,desc))`

This is a filter on `Carrier: JetBeats`. If I want to create a URL to show me results of a specific carrier, I would just need to make that value dynamic.

---

<div class="post-metadata">

**Author:** ![Dafna\_Frank](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@Dafna\_Frank](https://discuss.elastic.co/u/Dafna_Frank)\
**Post date:** [December 4, 2018, 5:37am UTC](https://discuss.elastic.co/t/generating-a-url-that-contains-a-query/159134/3 "2018-12-04T05:37:55Z")

</div>

Thank you.  
I;ve created a filter. How do I share this url now (so that I could make changes to the pod\_name?

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [December 4, 2018, 6:06am UTC](https://discuss.elastic.co/t/generating-a-url-that-contains-a-query/159134/4 "2018-12-04T06:06:14Z")

</div>

Click the share button at the top of Discover.

---

<div class="post-metadata">

**Author:** ![Dafna\_Frank](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@Dafna\_Frank](https://discuss.elastic.co/u/Dafna_Frank)\
**Post date:** [December 4, 2018, 6:17am UTC](https://discuss.elastic.co/t/generating-a-url-that-contains-a-query/159134/5 "2018-12-04T06:17:29Z")

</div>

> [@tylersmalley](#):
>
> Discover

I've created such filter, shared it. Copied the link from the saved dashboard then changed the name of the pod to a different one (3 places).  
Copied the link and paste it to a browser.  
What I got is a kibana page with the two different pods as a filter... which is not what I wanted...

Am I doing something wrong?  
Here is the link:  
[http://kibana-eslogs.outbrain.com:5601/app/kibana#/dashboard/4e3ebc20-f787-11e8-87fb-47a8ed084b01?\_g=(filters%3A!(('%24state'%3A(store%3AglobalState)%2Cexists%3A(field%3Aexception.keyword)%2Cmeta%3A(alias%3AExceptions%2Cdisabled%3A!t%2Cindex%3A'8fafd360-910c-11e8-ae83-59ddfdbdb492'%2Ckey%3Aexception.keyword%2Cnegate%3A!f%2Ctype%3Aexists%2Cvalue%3Aexists)](http://kibana-eslogs.outbrain.com:5601/app/kibana#/dashboard/4e3ebc20-f787-11e8-87fb-47a8ed084b01?_g=(filters%3A!(('%24state'%3A(store%3AglobalState)%2Cexists%3A(field%3Aexception.keyword)%2Cmeta%3A(alias%3AExceptions%2Cdisabled%3A!t%2Cindex%3A'8fafd360-910c-11e8-ae83-59ddfdbdb492'%2Ckey%3Aexception.keyword%2Cnegate%3A!f%2Ctype%3Aexists%2Cvalue%3Aexists)))%2C('%24state'%3A(store%3AglobalState)%2Cmeta%3A(alias%3A!n%2Cdisabled%3A!f%2Cindex%3A'8fafd360-910c-11e8-ae83-59ddfdbdb492'%2Ckey%3Akubernetes.pod\_name.keyword%2Cnegate%3A!f%2Cparams%3A(query%3Aservice-prod-shaharf-sa-86458858b7-579sd%2Ctype%3Aphrase)%2Ctype%3Aphrase%2Cvalue%3Aservice-prod-shaharf-sa-86458858b7-579sd)%2Cquery%3A(match%3A(kubernetes.pod\_name.keyword%3A(query%3Aservice-prod-shaharf-sa-86458858b7-579sd%2Ctype%3Aphrase)))))%2CrefreshInterval%3A(display%3AOff%2Cpause%3A!f%2Cvalue%3A0)%2Ctime%3A(from%3Anow-1h%2Cmode%3Aquick%2Cto%3Anow))

---

<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:** [January 1, 2019, 6:17am UTC](https://discuss.elastic.co/t/generating-a-url-that-contains-a-query/159134/6 "2019-01-01T06:17:31Z")

</div>

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