是否可以通过API调用来动态创建基巴纳可视化?
我是Kibana的新手,可以在Kibana中创建可视化,并将其添加到仪表板中。如果我想将它们嵌入我的网站,我需要单击share
,嵌入代码
,复制iframe代码
。是否可以在没有Kibana网站的情况下完成整个流程,并根据API并根据用户的需求(或过滤器)进行操作?
例如,在Elasticsearch中使用温度历史记录的简单数据集:
location timestamp temperature
A Jul.1 11:00 18
A Jul.1 17:00 20
A Jul.1 23:00 22
A Jul.2 5:00 24
A Jul.2 11:00 18
A Jul.2 17:00 20
A Jul.2 23:00 22
B Jul.1 11:00 32
B Jul.1 17:00 29
B Jul.1 23:00 27
B Jul.2 5:00 27
B Jul.2 11:00 32
B Jul.2 17:00 29
B Jul.2 23:00 27
在我们的网站中,用户可以通过
- 选择位置A来查看不同的嵌入式可视化,然后按条形图(温度历史记录)
- 选择位置A和B。过去2个月的时间范围,并逐件图表(温度历史记录)显示
- 高级需求,用户可以选择在饼图,区域图或热图等中显示。
可以通过基巴纳实现它吗?我该如何完成整个流程?
I am very new to Kibana, and I can create the visualizations in the Kibana and add them to the dashboard. If I want to embed them to my website, I need to click on Share
, Embed code
, Copy iFrame code
and paste it to the html. Is it possible complete the whole flow without Kibana website and do them by the API and according to the user's demand (or filter)?
For example, the simple dataset for the temperature history in the elasticsearch:
location timestamp temperature
A Jul.1 11:00 18
A Jul.1 17:00 20
A Jul.1 23:00 22
A Jul.2 5:00 24
A Jul.2 11:00 18
A Jul.2 17:00 20
A Jul.2 23:00 22
B Jul.1 11:00 32
B Jul.1 17:00 29
B Jul.1 23:00 27
B Jul.2 5:00 27
B Jul.2 11:00 32
B Jul.2 17:00 29
B Jul.2 23:00 27
In our website, user could view different embeded visualization by
- select for location A only, and display it by bar chart (temperature history)
- select for location A and B both, select the time range for the past 2 months, and display it by line chart (temperature history)
- For advanced requirement, user can choose to display in pie chart, area chart or heat map,...,etc.
Is it possible to achieve it by the Kibana? How can I do them for the whole flow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不可能使用Kibana,但是您可以使用Elasticsearch Search API与Kibana相同,还可以使用搜索API(DSL查询)从Elasticsearch获取数据。
您可以按照以下步骤进行操作:
对于您的第一个用途酶,您可以使用简单的
术语
查询并从Elasticsearch获取特定位置的数据。对于您的第二个用途酶,您可以使用
range
查询过滤器,然后使用汇总以获取值。It is not possible using Kibana but you can use the Elasticsearch Search API for same as Kibana also use the Search API (DSL query) for getting data from Elasticsearch.
You can follow below steps:
For your first usecase, you can use simple
term
query and get data from Elasticsearch for specific location.For your second usecase, you can use
range
query for filter and then aggregation for getting value.您可以通过上传保存的对象来创建新的可视化,而无需UI。但是,使用这种方法可能会限制结构和可能性。
iframe代码通常是指特定的Kibana端点 /可视化或仪表板URL。
使用保存的对象上传创建新的可视化后,您还知道将其放入iFrame所需的ID。
没有自己测试,但这应该起作用。
You can create new visualizations without the UI by uploading saved objects. However the structure and possibilities might be limited using this approach.
The iframe code usually refers a specific Kibana Endpoint / Visualization or Dashboard URL.
After creating a new visualization using the Saved Objects upload you also know the ID that is necessary to put it into the iframe.
Didn't test it myself but this should work.