Kulasangar
Kulasangar

Reputation: 9434

Creating dynamic dashboards depending on a field or filter?

I'm trying to generate dynamic graphs and dashboards, for example lets say I'm having a field called operator id, where values for it could be sequentially added on towards the future. So where as I'm giving the user the iframe url in order to view the dashboard.

So what I'm trying to ask is, is it possible to let the user to select the operator id from a drop down or maybe any other ui components within Kibana, so that Kibana would show the appropriate graph, where I shouldn't be creating graphs or dashboards manually to all the operator ids.

Instead if it has a template kinda graph, whenever the user selects an operator id, the graph should change accordingly. So for this to be possible, is there a way to write a script in order for Kibana to create those graphs dynamically?

I went through this ticket, which almost says that this feature has been missing after the Kibana v3. Hence this ticket gives a work around to generate the graphs based on the url. I'm not sure how feasible this is?

I'm currently using Kibana 5.0!

Hope I'm clear with the question. Any help could be appreciated.

Upvotes: 0

Views: 2842

Answers (3)

Lax
Lax

Reputation: 1167

Please have a look on the next kibana-API plugin,this plugin give you the ability to create visualisation dynamically, by send visualisation state. For example:

    var visPartial1 = {id: "myNewVis"};
 visPartial1["isFullState"] = false;
 visPartial1["visState"] = {visType: 'pie',
 field: 'city.keyword'};
 iWindow.postMessage({actionType:
 "setVisualization", visDefenetion:
 [visPartial1]}, '*

Kibana-API

Upvotes: 2

Dulguun
Dulguun

Reputation: 554

You can prepare a visualization and change its iframe URL to get the result you want.

  1. Create a visualization you want. (No need to save!)

    <iframe src="http://localhost:5601/app/kibana#/visualize/create?embed=true&type=area&indexPattern=sample...)" height="600" width="800"></iframe>
    
  2. Run query on it using Kibana.

    query_string:(analyze_wildcard:!t,query:'operator_id:6') // 6 is the value to change

    <iframe src="http://localhost:5601/app/kibana#/visualize/create?embed=true&type=area&indexPattern=sample ... query_string:(analyze_wildcard:!t,query:'operator_id:6' ..." height="600" width="800"></iframe>
    
  3. Copy the iframe URL clicking on Share Visualization button. (Don't Generate Short URL)

    And later you can change the value as much as you want. E.g:

    <iframe src="http://localhost:5601/app/kibana#/visualize/create?embed=true&type=area&indexPattern=sample ... query_string:(analyze_wildcard:!t,query:'operator_id:100' ..." height="600" width="800"></iframe>
    

    query_string:(analyze_wildcard:!t,query:'operator_id:100') // changed 6 to 100

  4. Reload iframe everytime the user chooses operator_id from drop down menu.

Upvotes: 1

Frank
Frank

Reputation: 308

I was also looking for this in Kibana and haven't found a solution of yet. The only thing I came up with is run Grafana next to Kibana because Grafana has templating build in to do exactly this.

Upvotes: 1

Related Questions