Export kibana visualization automatically ( type table )

Hello , I'm new with ELK Stack . I'm looking for this feature for 2 months now .
I have some agreegate data , that is in kibana visualization ( type table ) . I want to push every line in this table to another ElasticSearch . so every line will correspond to a document in my database .
So I have found that kibana give us a query to have the responds for tha data visualization . However , the response is not organized and it contains a lot of buckets . I want to Transfer this Json Format to a json that I could have the same display as my data table .

I ve seen that there"'s an export button that offers CSV file , but I want to do this automatically and not with UI .

Thanks in advance.

Would it work if your script submitted a HTTP request that the export button would initiate, without having to go through clicking on the UI?

1 Like

Thank you for your response .

Do you mean that I m capable to have the same display as the csv file with a http Request?
In this case , how can I so this ?
What I m already doing , is a http request with request that i have found in kibana. UI but as I have mentionned , the responses contains a lot of buckets and I cannot transfer this json to a table like the csv file .

It's not a documented API by any means - please check the network traffic in Chrome Dev Tools that occurs upon initiation of the export, to see if it's feasible.

1 Like

I ve checked this . It doesnt mentionnee anything when we export !

I have also checked the methode that converts to csv and i tried to understed angular directives ! But it s very complicated . I did not succeed to know what kibana does to display the table . I m sure that it is using the request but can t find how it change the reponse into this display :frowning:

So, when you clear the Network tab and hit Export, do you see new requests? (note: there can be unrelated network requests from polling etc. that are made periodically) Is the resulting data of the appropriate format? If it's eg. JSON rather than CSV, can you use a JavaScript utility to convert from JSON to CSV such as this (not a specific endorsement)?

hello . I think the export is done is the Client Side and not server Side . let me please explain more the use case .

For example I have this table visualization as mentionned . Here we could see the request and the response .
As you can , see in the response , we are having a lot of sub buckets . My goal is to transform the response of ES , so I every line of the table visualisation would be a document for me .
I have checked kibana code and finnaly I have found the methode that does this thing . it called tabifyAggResponse . As you can see here : https://github.com/elastic/kibana/blob/e5a94e7a1062f34471444ea29e20a844815842f6/src/ui/public/agg_response/tabify/tabify.js
This methode is taking Aggs object that I'm not able to know what is exactly the format and Esreponse which I think , it is the response of the request of ES.

Hope that you understand more the use case

So if I understand correctly, you have a JSON payload in your hands which you want to handle and reshape for your purposes, correct? Is it something that you can do with JavaScript code?

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