Embed query string into Markdown url


(Sri) #1

Hi,

In Kibana 5.2, I have tried to use the Markdown widget/visualization to include a url to a dashboard. However, when I try to include a query string in the url the dashboard is still displayed without the query filter.

here is my markdown contents.

This is a test

The issue seems that the query param from this URL is being appended with "&,g_..." part that includes another query_string with wildcard in it.

Is there no-way to override the query string into the url in my markdown widget?

btw, I escaped the query string's parenthesis to overcome the markdown limitation mentioned in other threads.


(CJ Cenizal) #2

Hi Sri, it looks like your markdown didn't paste correctly. Could you try sharing it again, but enclose inside of triple backticks? Like this:

```
[url example](your/url?goes=here)
```

Thanks,
CJ


(Sri) #3

Hi CJ,

Hope this works better.

This is [alink]( /kibana/app/kibana#/dashboard/2a7b7060-a3cf-11e7-9429-855a0ebac786?query:%28query_string:%28analyze_wildcard:!t,query:'test'%29%29)

And when I click on this link, my browser shows this url. Notice the multiple "query" sections, including the 2nd with wildcard "*".

<host-name>/kibana/app/kibana#/dashboard/2a7b7060-a3cf-11e7-9429-855a0ebac786?query:(query_string:(analyze_wildcard:!t,query:'test'))&_g=(refreshInterval:(display:'30%20seconds',pause:!t,section:1,value:30000),time:(from:now-7d,mode:absolute,to:now))&_a=(filters:!(),options:(darkTheme:!f),panels:!((col:1,id:cf3a7c00-a3c9-11e7-9429-855a0ebac786,panelIndex:1,row:2,size_x:6,size_y:5,type:visualization),(col:7,id:'947c8310-9e5b-11e7-80bf-d53476d5c7d3',panelIndex:2,row:2,size_x:6,size_y:5,type:visualization),(col:1,id:fb094a50-a3ce-11e7-9429-855a0ebac786,panelIndex:3,row:7,size_x:6,size_y:4,type:visualization),(col:1,id:'3f113260-a539-11e7-9014-011d031c2b98',panelIndex:4,row:1,size_x:12,size_y:1,type:visualization)),query:(query_string:(analyze_wildcard:!t,query:'*')),title:PV.Host.Health,uiState:())

Thx


(CJ Cenizal) #4

Thanks, Sri! I understand the problem you're experiencing. However, I just tried to reproduce it using the following steps and wasn't able to do so:

  1. In a dashboard, click the "Share" link in the top right.
  2. Under "Share Snapshot > Link" (on the right side of the panel), I clicked the "Copy" link.
  3. I did a find/replace for the parentheses to escape them the same way you did.
  4. I then added a markdown link the same way you did.

When I clicked on the link, the dashboard opened up without any problems. Could you try creating your link the same way I did, using the "Share" menu, and let me know if this solves your problem? If not, could you tell me which version of Kibana you're using?

Thanks,
CJ


(Sri) #5

Thanks CJ,

It works using your steps.

The full url is very long when I copied to the markdown & also has the name of the dashboard (which could change in future, for example). So, I was trying to find a way to only include the query parameter in the markdown & led to the problem I faced. Infact, originally I tried to append the query string to the short-url that I got from the "Share" menu off the dashboard (i.e /kibana/goto/d7265500ebeabba7f6f2b51a6a3a6fad)

btw, I mentioned Kibana 5.2 - is that is the version you are asking about?


(CJ Cenizal) #6

Oh, sorry I didn't notice the Kibana version you mentioned originally. I'm glad this fixes your problem!

CJ


(Sri) #7

btw, just to confirm - there is no other (better) way to include a query string into the markdown URL? Like the dashboard name, I'm afraid other parts of the url could change and break my links unexpectedly.


(Sri) #8

Quick update: This variant of the "shortened" url also seem to work and addresses my concerns. Its essentially an empty "_g" and an "_a" with only the query string.

/kibana/app/kibana#/dashboard/2a7b7060-a3cf-11e7-9429-855a0ebac786?_g=%28%29&_a=%28query:%28query_string:%28analyze_wildcard:!t,query:'test'%29%29%29

Not sure if this will cause problems later, but I may use this unless I hear advise to the contrary :slight_smile:


(CJ Cenizal) #9

Thanks for sharing the update, Sri! I think that's probably the best solution.


(system) #10

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