# Kibana API output

**URL:** <https://discuss.elastic.co/t/kibana-api-output/325776>\
**Category:** Kibana\
**Created:** [February 16, 2023, 8:34pm UTC](https://discuss.elastic.co/t/kibana-api-output/325776 "2023-02-16T20:34:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![branden.heifner](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@branden.heifner](https://discuss.elastic.co/u/branden.heifner)\
**Post date:** [February 16, 2023, 8:34pm UTC](https://discuss.elastic.co/t/kibana-api-output/325776/1 "2023-02-16T20:34:01Z")

</div>

Hello everyone,

I am using the Kibana API to output the list of agent for auditing purposes. Is there a built-in way to output the list of agents in CSV format instead of JSON? Below is the current API call I am using.

curl --location --request GET '[https://kibana/api/fleet/agents?perPage=500](https://kibana/api/fleet/agents?perPage=500)'

Thank you!

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [February 17, 2023, 1:37am UTC](https://discuss.elastic.co/t/kibana-api-output/325776/2 "2023-02-17T01:37:57Z")

</div>

Not Not nativley

Perhaps take a look at...

> **[Convert JSON to CSV with JQ](https://richrose.dev/posts/linux/jq/jq-json2csv/)**
>
> Extend command-line fu with JSON files

`jq` is awesome

Wow I just found this helpful article with several different ways

> **[How to Convert from JSON to CSV at The Command Line](https://earthly.dev/blog/convert-to-from-json/)**
>
> How do you convert JSON values to CSV and back at the command line? I’ve done this task on many occasions and been stung by the edge cases frequent...

---

<div class="post-metadata">

**Author:** ![branden.heifner](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@branden.heifner](https://discuss.elastic.co/u/branden.heifner)\
**Post date:** [February 27, 2023, 8:16pm UTC](https://discuss.elastic.co/t/kibana-api-output/325776/3 "2023-02-27T20:16:36Z")

</div>

Awesome, thank you @stephenb!

---

<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:** [March 27, 2023, 8:17pm UTC](https://discuss.elastic.co/t/kibana-api-output/325776/4 "2023-03-27T20:17:33Z")

</div>

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