# Is it possible to generate or export a csv from Kibana dev tool

**URL:** https://discuss.elastic.co/t/is-it-possible-to-generate-or-export-a-csv-from-kibana-dev-tool/343027
**Category:** Kibana
**Created:** [September 14, 2023, 8:33am UTC](https://discuss.elastic.co/t/is-it-possible-to-generate-or-export-a-csv-from-kibana-dev-tool/343027 "2023-09-14T08:33:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JasonREC](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@JasonREC](https://discuss.elastic.co/u/JasonREC)
#### Post date: [September 14, 2023, 8:33am UTC](https://discuss.elastic.co/t/is-it-possible-to-generate-or-export-a-csv-from-kibana-dev-tool/343027/1 "2023-09-14T08:33:36Z")

</div>

Hi, I wonder if it is possible to generate a CSV report from dev tool ?

The following is my query run on Kibana dev tool, it composed of query and aggregation.  
I want to generate the query response to a csv.

if it is not possible, is there a way can let me generate a csv based on my query result

```auto
GET remo-traces-apm/_search
{
  "size": 0,
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "function_id": "504"
          }
        },
        {
          "term": {
            "deviceId": "0"
          }
        }
      ]
    }
  },
  "aggs": {
    "Project_id": {
      "terms": {
        "size": 50,
        "field": "project_id"
      },
      "aggs": {
        "Pa_key": {
          "terms": {
            "size": 10000,
            "field": "pa_key"
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [September 14, 2023, 10:26am UTC](https://discuss.elastic.co/t/is-it-possible-to-generate-or-export-a-csv-from-kibana-dev-tool/343027/2 "2023-09-14T10:26:38Z")

</div>

Hi @JasonREC,

There is a CSV export under the share option in discover, but not directly in the DevTools. But I can think of a couple of ways to potentially get the data out:

1. Writing a script using a language client and a CSV utility, such as Python. There is a [StackOverflow thread here](https://stackoverflow.com/questions/46682018/export-elasticsearch-results-into-a-csv-file) that shares that example.
2. Using Logstash with an [Elasticsearch filter processor](https://www.elastic.co/guide/en/logstash/current/plugins-filters-elasticsearch.html#plugins-filters-elasticsearch-query) and the [CSV output plugin](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-csv.html).

Others can maybe suggest other options as I'm sure there are other ways.

Hope that helps!

---

<div class="post-metadata">

### Author: ![JasonREC](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@JasonREC](https://discuss.elastic.co/u/JasonREC)
#### Post date: [September 19, 2023, 8:38am UTC](https://discuss.elastic.co/t/is-it-possible-to-generate-or-export-a-csv-from-kibana-dev-tool/343027/3 "2023-09-19T08:38:11Z")

</div>

@carly.richmond

Thanks for the suggestion. I eventually used the alternative 1 which is with the Python script

---

<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: [October 17, 2023, 8:39am UTC](https://discuss.elastic.co/t/is-it-possible-to-generate-or-export-a-csv-from-kibana-dev-tool/343027/4 "2023-10-17T08:39:04Z")

</div>

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