# Pretty option for kibana rest api?

**URL:** <https://discuss.elastic.co/t/pretty-option-for-kibana-rest-api/318213>\
**Category:** Kibana\
**Created:** [November 4, 2022, 7:12pm UTC](https://discuss.elastic.co/t/pretty-option-for-kibana-rest-api/318213 "2022-11-04T19:12:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [November 4, 2022, 7:12pm UTC](https://discuss.elastic.co/t/pretty-option-for-kibana-rest-api/318213/1 "2022-11-04T19:12:32Z")

</div>

I tried running this command:

```auto
curl -X GET -u myuser:mypass "https://localhost:5601/api/alerting/rules/_find?pretty=true"

```

But I get the error

```auto
{"statusCode":400,"error":"Bad Request","message":"[request query.pretty]: definition for this key is missing"}

```

If I remove the `?pretty=true` from my request, then everythign works fine. What is the option that I can pass to get pretty formatted json when working with kibana rest api?

---

<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:** [November 5, 2022, 12:44am UTC](https://discuss.elastic.co/t/pretty-option-for-kibana-rest-api/318213/2 "2022-11-05T00:44:06Z")

</div>

Do not looks like there is one ... huh...

I use [jq](https://stedolan.github.io/jq/) all the time for all sorts of things

Then you just do ..

```auto
curl http://localhost:5601/api/index_management/indices | jq
[
  {
    "health": "green",
    "status": "open",
    "name": ".apm-agent-configuration",
    "uuid": "dWjl3Z1hTNqjbD_4RSn7aA",
    "primary": "1",
    "replica": "0",
    "documents": 0,
    "documents_deleted": 0,
    "size": "225b",
    "primary_size": "225b",
    "isFrozen": false,
    "aliases": "none",
    "hidden": true,
    "ilm": {},
    "isRollupIndex": false,
    "isFollowerIndex": false
  },
...

```

Then you can or fun stuff like .. look into the array and give me all the values with key `name`

```auto
curl http://localhost:5601/api/index_management/indices | jq .[].name
".apm-agent-configuration"
".apm-custom-link"
".ds-.logs-deprecation.elasticsearch-default-2022.10.31-000001"
".ds-ilm-history-5-2022.10.31-000001"
".kibana-event-log-8.4.3-000001"
".kibana_8.4.3_001"
".kibana_task_manager_8.4.3_001"
".tasks"
"testing-7.17.3-cisco.asa-2022.10.31"

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 5, 2022, 1:58am UTC](https://discuss.elastic.co/t/pretty-option-for-kibana-rest-api/318213/3 "2022-11-05T01:58:58Z")

</div>

This would make a really good feature request if you would be up for opening on on GitHub? 🙂

---

<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:** [December 3, 2022, 1:58am UTC](https://discuss.elastic.co/t/pretty-option-for-kibana-rest-api/318213/4 "2022-12-03T01:58:59Z")

</div>

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