# Set metrics:max\_buckets with curl

**URL:** <https://discuss.elastic.co/t/set-metrics-max-buckets-with-curl/105941>\
**Category:** Kibana\
**Created:** [October 31, 2017, 6:36pm UTC](https://discuss.elastic.co/t/set-metrics-max-buckets-with-curl/105941 "2017-10-31T18:36:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)\
**Post date:** [October 31, 2017, 6:36pm UTC](https://discuss.elastic.co/t/set-metrics-max-buckets-with-curl/105941/1 "2017-10-31T18:36:53Z")

</div>

Hi,  
I want to change the default value of "metrics:max\_buckets" at startup of Kibana.  
The end user should not have to go into advanced settings and change this for each kibana instance.

I have tried curl command to set it but not succeed.  
I get code 400 in return every time.

Can someone tell me what is wrong?

> curl --verbose -POST "[http://kibana:5601/api/kibana/settings/metrics:max\_buckets](http://kibana:5601/api/kibana/settings/metrics:max_buckets)" -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linu…) Gecko/20100101 Firefox/56.0' -H 'Accept: application/json, text/plain, _/_' -H 'Acc  
> ept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip' -H 'Content-Type: application/json;charset=utf-8' -H 'kbn-version: 5.6.3' -d '{"value":"3000"}'
> 
> - Trying 10.68.32.158...
> - TCP\_NODELAY set
> - Connected to kibana.service.consul (10.68.32.158) port 5601 (#0)
> 
> > POST /api/kibana/settings/metrics:max\_buckets HTTP/1.1  
> > Host: kibana.service.consul:5601  
> > User-Agent: Mozilla/5.0 (X11; Ubuntu; Linu…) Gecko/20100101 Firefox/56.0  
> > Accept: application/json, text/plain, _/_  
> > Accept-Language: en-US,en;q=0.5  
> > Accept-Encoding: gzip  
> > Content-Type: application/json;charset=utf-8  
> > kbn-version: 5.6.3  
> > Content-Length: 16
> 
> - upload completely sent off: 16 out of 16 bytes  
> \< HTTP/1.1 400 Bad Request  
> \< kbn-name: kibana  
> \< kbn-version: 5.5.2  
> \< content-type: application/json; charset=utf-8  
> \< cache-control: no-cache  
> \< vary: accept-encoding  
> \< content-encoding: gzip  
> \< Date: Tue, 31 Oct 2017 18:34:57 GMT  
> \< Connection: keep-alive  
> \< Transfer-Encoding: chunked  
> \<  
> Warning: Binary output can mess up your terminal. Use "--output -" to tell  
> Warning: curl to output it to your terminal anyway, or consider "--output  
> Warning: " to save to a file.
> - Failed writing body (0 != 10)
> - Failed writing data
> - Closing connection 0

Br Mathias

---

<div class="post-metadata">

**Author:** ![a5a](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@a5a](https://discuss.elastic.co/u/a5a)\
**Post date:** [October 31, 2017, 7:13pm UTC](https://discuss.elastic.co/t/set-metrics-max-buckets-with-curl/105941/2 "2017-10-31T19:13:19Z")

</div>

Could you try it again with kbn-version 5.5.2 in the request header?

---

<div class="post-metadata">

**Author:** ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)\
**Post date:** [October 31, 2017, 8:29pm UTC](https://discuss.elastic.co/t/set-metrics-max-buckets-with-curl/105941/3 "2017-10-31T20:29:29Z")

</div>

It worked, thanks!!!

I did not notice I was running towards an old instance.

Br Mathias

---

<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:** [November 28, 2017, 8:29pm UTC](https://discuss.elastic.co/t/set-metrics-max-buckets-with-curl/105941/4 "2017-11-28T20:29:43Z")

</div>

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