-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a link to a search #168
Create a link to a search #168
Comments
There is currently no way to generate links to searchs via a url parameter, but there are several ways to link to saved searches/dashboards. Queries persist on the dashboard when it is saved Examples: You can also click the share link in the Dash Control panel to generate a temp link that lives for 30 days by default. If you were feeling particularly hacky you could write a script that generated dashboards from some parameter and stick it in the dashboards directory, but thats probably not a great idea :-) |
Yeah, I want to be able to generate a link that would show all records of a certain action by a user. I saw the example in the docs of using chef to define dashboards but it seemed pretty hacky as a way to implement this. |
To extend this further, it would be nice to dynamically keep the search filter in the URL temporarily such that a page refresh doesn't completely bork your results |
Storing the state in the url is not feasible. Storing it in html5 localStorage might be. Something to think about. |
For what is worth, we deployed Kibana 2 and are using its serialized JSON URL hash parameter to link to the logs search. |
@rashidkpc Why is it not feasible? Couldn't it use something like https://github.com/browserstate/history.js and just muck with the url that way? |
This feature was available in the previous version of Kibana, where you could just base64 encode a json string, tack it onto the URL and it used that as search terms. I don't understand why the current version of Kibana can't do the same thing? Just have the JS parse an appropriate part of the URL, then put the search terms into the search box and perform the search. Surely you could just copy it straight from the URL and put it into the search box as the page loads. Is there any intention to bring this feature back? |
The reason is because there is not a single way to populate a query. It could be in a stringquery input, but it could also be on a specific panel, or it could be multiple queries, or multiple queries generated by derivequeries. So passing a single query in the URL doesn't really work out. Storing the entire state in the URL would make for a -huge- URL. A quick test of a simple dashboard works out to a ~9000 character URL, rison would make it a bit smaller. Its not technically a problem, modern browsers can handle URLs much much larger. |
It would be great to have the option of supplying such a string to the URL, so that dashboards could be generated and loaded on the fly. |
I stand beside @spble. One of my most important use case of kibana is the url-jumping feature in previous kibana. In my situation, I'd like to wrap kibana query-semantics in my own app and pass these semantics to kibaba (just like kibana2). It would be really cool if this feature is enable in the future. :) |
I've make some simple code on panels/dashcontrol/module.js to enable this little feature. I'll complete in recent time. |
+1 on this feature.. Lack of it took a big use case for us down. |
i have made simple on js so that you can pass some parameters in url and Frank Yao 在 2013-7-29,21:29,Michal Bicz [email protected] 写道: +1 on this feature.. Lack of it took a big use case for us down. — |
+1 |
1 similar comment
+1 |
I'm trying to move codes on old kibana3 to new kibana3 today |
I've made a pull request #361 . You can found a solution there. :) |
Oh, thanks! |
I've just pushed the first code to my own repo for accomplishing this in a flexible way. It allows for any dashboard or panel attribute to be set via the URL, with configurable URL parameter naming, without any panel or service needing to really know about it. The solution is comprised of 2 different ways of templating dashboards, mustache (eg {{query}}) templated JSON, and totally custom javascript dashboard building. See #448 for usage details. |
Just merged the branch I'm still working on ideas for nicely allowing the configuration of template parameters via the browser. For now have 3 options: Method 1
See https://github.com/elasticsearch/kibana/blob/master/dashboards/logstash.json for an example of a templated dashboard Method 2
Method 3 (advanced users only)
See https://github.com/elasticsearch/kibana/blob/master/dashboards/logstash.js for an example of a scripted dashboard. |
I figured the default dashboard works but how do I specify a timerange. e.g. this is the url I have http://plmgmtlogger2.prodlabs.local/k3/#/dashboard/file/default.json?query=field1:"value1" AND field2:"value2" |
All three workarounds posted above suffer from the fact that they are not "sticky". If you open such a dashboard and then Save it, you may lose URL query substitution. So you have to remember to reapply the patch or syntax every time you define or redefine a config. This becomes a major problem if you expose configuration customization to users. RE: query string potentially coming from multiple sources. Why not use precedence? I.e.: URL query overrides anything saved by the configuration, etc. |
This has helped me tremendously and just wanted to give a thanks first. As for the saving issue, I think the quickest and easiest way to solve it would be to have a query flag to suppress the parsing so we could get the raw template back and modify it. Maybe something like ?parseArgs=0 This is in reference to #662 |
@sanj75 You could try to add @datefield:["now-1h" TO "now"] as a second parameter |
@dshelepov and @cphillips83 - I too have run into this issue. My work around to prevent accidental overwriting of the the board is to turn off saving to elastic search and only allow saves via export. Click on the gears in the upper right corner of the entire board and make it look like this: |
Is the {{ARGS=query || ''}} option supported for Kibana 3? I am getting the following error when saving the dashboard |
I
|
@mdadarkar I ran into the same issue. |
This commit moves the logic of the request body autocomplet to use the new engine current used by url and url param suggestions. Also change $FIELD$ & friends notation to {field}, {index} etc. Closes elastic#168
I would like to be able to create a link to a search, so I can create links to Kibana from our admin dashboard to show a particular user's logs.
I looked around for this functionality and couldn't find it, but correct me if I'm wrong.
The text was updated successfully, but these errors were encountered: