Hi, I'm trying to create some custom visualizations by developing kibana plugins, for example, one of them is for displaying a cumulative sum of uptime and downtime over the time, the sum should restart whenever I see a change from up to down or vice versa. To calculate that I need to use all of the records, so I need to get somehow the hits part of ES response instead of the aggs part inside my plugin, is that possible?
An alternative that I'm using is Terms aggregation on @timestamp and Terms aggregation on the other fields that I'm insterested in, but that way I'm limiting the number of records to bucket size parameter, is there a way to set the bucket size parameter to null or to remove the size parameter from my plugin so I can get all of the buckets with no limit?
You can also directly fetch the records your looking for. There are helpers, like callWithRequest to aide in making the ES calls through elasticsearch-js.
Hi @thomasneirynck and @tylersmalley, thanks for your answers, I'm a little confused, I'm using VisFactory.createAngularVisualization to create my visualization, can I use these custom queries you are talking about within this type of visualization?, do I have to use a custom requestHandler or something like that? I was able to query ES using a custom requestHandler but now I don't know how to use the response from my controller, any suggestion?
You can probably ignore the response-handler for now, since you are working with raw data.
fwiw I would advise against using the angular-visualization, Kibana is moving away from Angular in the long term. I would just use the BasesVisualization type for a first pass.
@thomasneirynck Im trying now with BaseVisualization but I still can't get the raw data, with Angular I was trying something like this within the requestHandler:
but I just couldn't return the data to the controller because I think it is an async function, would you share with me an example of querying raw data (hits part of ES response) with this BaseVis?
I think a good working example would be to look into how the Vega-plugin is structured (core_plugins/vega). It is a base-visualization, with its own custom requesthandler, and does a custom to query ES.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.