# \[Visualizations\]\[CSV\] Is there a way to automate visualizations CSVs download?

**URL:** <https://discuss.elastic.co/t/visualizations-csv-is-there-a-way-to-automate-visualizations-csvs-download/224189>\
**Category:** Kibana\
**Created:** [March 18, 2020, 9:33pm UTC](https://discuss.elastic.co/t/visualizations-csv-is-there-a-way-to-automate-visualizations-csvs-download/224189 "2020-03-18T21:33:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaratustra689](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaratustra689/32/43118_2.png) [@zaratustra689](https://discuss.elastic.co/u/zaratustra689)\
**Post date:** [March 18, 2020, 9:33pm UTC](https://discuss.elastic.co/t/visualizations-csv-is-there-a-way-to-automate-visualizations-csvs-download/224189/1 "2020-03-18T21:33:27Z")

</div>

I know that when you create a report, using a saved search, it's easy to automate the generation of CSVs cause the platform (Kibana) provide us a beautiful `curl` with the proper query and endpoint.  
The problem I had with that, is that generated CSVs only supports a miximun size of 10MB, which is not sufficient for my needs, cause my need is to save selected data before I delete indices (much more data that the one I can save in 10MB). So I discarded csv generation through reports.

I've been thinking that a good approach would be saving the data I have in some visualizations, so I don't have to save all index data.  
I know that when you inspect a visualization, you can get the json request and the json reponse of that visualization. I've been also reading through a lot of existing posts in differents forums, and realized that if you use a plugin or tool (such as `elasticsearch-data-plugin` or `es2csv`) with the query the visualization provides, they can download that data in a csv file. The problem is that the output is not the same one as the one we can see in the kibana UI: the output they bring is a csv with the results of a query but without the aggregation made by the visualization.

So the question is: Is there a way to get via api the following csv that the viusalization provides?  
Querying the request that the visualization shows (kibana UI) does not output the same 'table' as this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/1/f17020739ac26259224232c608cf950885452d62.png)

I clearly need a way to download this csv without pressing that button (Download CSV), cause I need an automated way to do it.

---

<div class="post-metadata">

**Author:** ![LizaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lizad/32/51074_2.png) [@LizaD](https://discuss.elastic.co/u/LizaD)\
**Post date:** [March 19, 2020, 1:14pm UTC](https://discuss.elastic.co/t/visualizations-csv-is-there-a-way-to-automate-visualizations-csvs-download/224189/2 "2020-03-19T13:14:30Z")

</div>

Hi @zaratustra689,

It's been awhile since your last post, welcome back!

I can not find any API that we have currently to do this, as you found it seems the Kibana UI request returns JSON, so an option would be to write a script to parse that into csv format.

Pinging @joelgriffith if he has any other ideas that may help you achieve this.

Thanks!  
Liza

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 16, 2020, 1:23pm UTC](https://discuss.elastic.co/t/visualizations-csv-is-there-a-way-to-automate-visualizations-csvs-download/224189/3 "2020-04-16T13:23:52Z")

</div>

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