# Why doesn't \_cat/recovery honor the bytes=XX in the URI?

**URL:** <https://discuss.elastic.co/t/why-doesnt-cat-recovery-honor-the-bytes-xx-in-the-uri/173241>\
**Category:** Elasticsearch\
**Created:** [March 21, 2019, 2:49am UTC](https://discuss.elastic.co/t/why-doesnt-cat-recovery-honor-the-bytes-xx-in-the-uri/173241 "2019-03-21T02:49:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![slmingol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/slmingol/32/12606_2.png) [@slmingol](https://discuss.elastic.co/u/slmingol)\
**Post date:** [March 21, 2019, 2:49am UTC](https://discuss.elastic.co/t/why-doesnt-cat-recovery-honor-the-bytes-xx-in-the-uri/173241/1 "2019-03-21T02:49:13Z")

</div>

I'm trying to change the units for the following API call:

```
GET /_cat/recovery?bytes=gb

```

The docs around the cat API imply that you can do this, but the recovery endpoint doesn't seem to work with this. The units are always shown in bytes.

Example:

```
GET '_cat/recovery?bytes=gb&v&h=index,shard,time,type,stage,source_node,target_node,files,files_recovered,files_percent,bytes_total,bytes_percent' | grep -v done | head
index shard time type stage source_node target_node files files_recovered files_percent bytes_total bytes_percent
filebeat-6.5.1-2019.03.06 0 2.7h peer index rdu-es-data-01e rdu-es-data-01b 268 262 97.8% 218212992946 85.2%
filebeat-6.5.1-2019.03.06 1 2.7h peer index rdu-es-data-01a rdu-es-data-01e 277 276 99.6% 228721023484 98.6%
filebeat-6.5.1-2019.03.05 1 2.1h peer index rdu-es-data-01d rdu-es-data-01b 271 262 96.7% 203869559392 77.1%

```

REF: [https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 21, 2019, 8:38am UTC](https://discuss.elastic.co/t/why-doesnt-cat-recovery-honor-the-bytes-xx-in-the-uri/173241/2 "2019-03-21T08:38:57Z")

</div>

Which version are you using?  
Do you see the same behavior with other APIs such as:

```auto
GET /_cat/indices?bytes=mb

```

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 21, 2019, 8:42am UTC](https://discuss.elastic.co/t/why-doesnt-cat-recovery-honor-the-bytes-xx-in-the-uri/173241/3 "2019-03-21T08:42:01Z")

</div>

It looks like this is an oversight in the code that serves the `GET _cat/recovery` API:

> <https://github.com/elastic/elasticsearch/blob/99f88f15c5febbca2d13b5b5fda27b844153bf1a/server/src/main/java/org/elasticsearch/rest/action/cat/RestRecoveryAction.java#L167-L170>

These values are returned as numbers, not as `ByteSizeValue`s, so the `?bytes=` parameter doesn't apply. Could you open an issue on Github, @slmingol?

---

<div class="post-metadata">

**Author:** ![slmingol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/slmingol/32/12606_2.png) [@slmingol](https://discuss.elastic.co/u/slmingol)\
**Post date:** [March 21, 2019, 11:08pm UTC](https://discuss.elastic.co/t/why-doesnt-cat-recovery-honor-the-bytes-xx-in-the-uri/173241/4 "2019-03-21T23:08:36Z")

</div>

Sure thing. I confirmed that other API cmds seem to honor the bytes=X

```auto
$ GET '_cat/indices?v&bytes=gb' | head -3
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open f5-2019.03.12 _XRY7YR7RGKAI73U1jy3oQ 1 1 66927007 0 39 20
green open syslog-2019.03.20 QXr_EtrjROOFhCONRLY8EA 1 1 109095296 0 140 70

```

```auto
$ GET '_cat/indices?v&bytes=mb' | head -3
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open f5-2019.03.12 _XRY7YR7RGKAI73U1jy3oQ 1 1 66927007 0 40924 20539
green open syslog-2019.03.20 QXr_EtrjROOFhCONRLY8EA 1 1 109095296 0 143608 71786

```

---

<div class="post-metadata">

**Author:** ![slmingol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/slmingol/32/12606_2.png) [@slmingol](https://discuss.elastic.co/u/slmingol)\
**Post date:** [March 21, 2019, 11:30pm UTC](https://discuss.elastic.co/t/why-doesnt-cat-recovery-honor-the-bytes-xx-in-the-uri/173241/5 "2019-03-21T23:30:05Z")

</div>

Link to issue in github - [https://github.com/elastic/elasticsearch/issues/40335](https://github.com/elastic/elasticsearch/issues/40335).

---

<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 18, 2019, 11:36pm UTC](https://discuss.elastic.co/t/why-doesnt-cat-recovery-honor-the-bytes-xx-in-the-uri/173241/6 "2019-04-18T23:36:27Z")

</div>

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