Export visualisation data to JSON by API (with filters)

Hi there,
First post, but I've read tens of them to find an answer, without results.

I need to display visualisations to users based on their own 2 attributes : "brandList" and "concessionList". Both lists may contain tens of elements, among thousands. I need to make sure that a user can't access data not tagged with his attributes.
I think roles isn't an option here because I would have to create tens of thousands of them and update them continuously. This would mean (as far as I understand Kibana) that I can't create Kibana's users for my App's users based on their attributes and share a dashboard to them.

I want to give my operation & sales teams ability to build visualisations and give access to our numerous users, without involving too much time from the tech team and without compromise on security.

My analysis leads me to conclude that I have no other choice than to get the data by my backend from a given visualisation with proper filters (on brandList, concessionList, dates and whatever other fields the user would like to add) and display it in another chart using for example Amcharts on my website.
I would ask operation & sales teams to build the visualisations in Kibana (for their own use, no direct access to external users), then select and adapt similar visualisations in Amcharts.
The developers would get the data from each visualisation in JSON format and feed this JSON to our frontend's Amcharts chart replica.

1/ am I building something too complex and there's a much nicer option ? (not found yet)
2/ how to download JSON data of a given visualisation with filters in 1 request ? (existing post relates to deprecated solutions! I can't find the "REQUEST" button on my visualisations)
3/ regarding mapping of ES JSON --> Amcharts JSON... well I'll investigate once I see what I can download from ES.

Thanks for reading and help you may provide.

PS : So far, we're using Kibana 6.4.3 as SaaS product and we've also installed a solution on premises to add external plugins.

I think roles isn't an option here because I would have to create tens of thousands of them and update them continuously. This would mean (as far as I understand Kibana) that I can't create Kibana's users for my App's users based on their attributes and share a dashboard to them.

The Elastic Stack solution here would be Document-Level Access Control, where documents contain attributes that are used to determine the access. In other words: Attribute-Based Access Control. We have a blog post going into that feature: https://www.elastic.co/blog/attribute-based-access-control-with-xpack

I have no other choice than to get the data by my backend from a given visualisation

Unfortunately, the visualization data as it's stored in the .kibana index is not in a publicly-readable format. It contains a lot of fields for state and there is no documentation on what is what, or how to convert that visualization state into an ES query. There is no API that would convert raw saved object data to something that can call ES or generate its query for you, either. Most of the reason why there is that this internal state is highly subject to breaking changes: it will cost you a lot of time if you try to build a bridge to it as a data source. When it changes, your bridge will fall in the ocean. I'm not familiar with the deprecated solutions you found, but it seems like this is what happened to them.

I want to give my operation & sales teams ability to build visualisations and give access to our numerous users, without involving too much time from the tech team and without compromise on security.

Sounds like a great feature, but Kibana does not offer that capability. The best way to get JSON data out of the system for now is to query ES.

display it in another chart using for example Amchartson my website.

The supported way of doing this in Kibana is to host a Kibana URL in an IFrame. There is an IFrame URL you can copy-and-paste in the "Share" menu (where it is exactly depends on which version) of the toolbars of the Visualization app and Dashboard app.

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