# How to set the value of "total\_fields" by using curl?

**URL:** https://discuss.elastic.co/t/how-to-set-the-value-of-total-fields-by-using-curl/198196
**Category:** Elasticsearch
**Created:** [September 5, 2019, 8:20am UTC](https://discuss.elastic.co/t/how-to-set-the-value-of-total-fields-by-using-curl/198196 "2019-09-05T08:20:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![terrymu](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@terrymu](https://discuss.elastic.co/u/terrymu)
#### Post date: [September 5, 2019, 8:20am UTC](https://discuss.elastic.co/t/how-to-set-the-value-of-total-fields-by-using-curl/198196/1 "2019-09-05T08:20:09Z")

</div>

Hi Experts,

I'm parsing my source logs then meeting an issue such like this:

> [2019-09-05T15:56:34,215][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"lsh\_nokia\_nokiasbc-2019.09.05", :\_type=\>"\_doc", :\_routing=\>nil}, #LogStash::Event:0x734643a0], :response=\>{"index"=\>{"\_index"=\>"lsh\_nokia\_nokiasbc-2019.09.05", "\_type"=\>"\_doc", "\_id"=\>"XqRsAG0Bb-u0KskwxgGb", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"**Limit of total fields [1000]** in index [lsh\_nokia\_nokiasbc-2019.09.05] has been exceeded"}}}}

I have search the similar issues that the solution point we need modify the value of total\_fields.

I have also check the currently value of it from my elasticsearch index:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/a/3afe946f5bfa18e2f7be43375ea55acdfef692b2.png)

It is 1000 but i can't modify by using kibana GUI.

I have tried to use curl to execute elasticsearch console command to modify it, I execute a lot of methods which showed as below, but all of them are returned failed.

> [admin@HPG5L3 ~]$ curl -XPUT localhost:9200/\_template/lsh\_nokia\_nokiasbc-2019.09 .05 -d ' { "settings" : { "index.mapping.total\_fields.limit" : "2000" } }'  
> {"error":"Content-Type header [application/x-www-form-urlencoded] is not support [admin@HPG5L3 ~]$ curl -XPUT localhost:9200/\_template/lsh\_nokia\_nokiasbc-2019.09.05 -d ' { "settings" : { "index.mapping.total\_fields.limit" : "2000" } }'  
> {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}[admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$ curl -XPUT localhost:9200/\_template/lsh\_nokia\_nokiasbc-2019.09.05 -d ' { "default" : { "total\_fields.limit" : "3000" } }'  
> {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}[admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$ curl -XPUT localhost:9200/\_template/lsh\_nokia\_nokiasbc-2019.09.05 -d ' { "settings" : { "total\_fields.limit" : "3000" } }'  
> {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}[admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$  
> [admin@HPG5L3 ~]$ curl -XPUT localhost:9200/\_template/lsh\_nokia\_nokiasbc-2019.09.05 -d '
> 
> > {  
> > "order" : 1,  
> > "index\_patterns": ["lsh\_nokia\_nokiasbc-2019.09\*"],  
> > "settings" : {  
> > "index.mapping.total\_fields.limit": 3000,  
> > }  
> > }'  
> > {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}[admin@HPG5L3 ~]$  
> > [admin@HPG5L3 ~]$

I don't know the root cause why I modified failed, would you please help me debug it how to modify the total\_fields value? Thank you.

---

<div class="post-metadata">

### Author: ![terrymu](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@terrymu](https://discuss.elastic.co/u/terrymu)
#### Post date: [September 5, 2019, 8:26am UTC](https://discuss.elastic.co/t/how-to-set-the-value-of-total-fields-by-using-curl/198196/2 "2019-09-05T08:26:02Z")

</div>

@ [guyboertje](https://discuss.elastic.co/u/guyboertje)[Elastic Team Member](https://discuss.elastic.co/g/elastic_team)  
@guyboertje  
Would you please help check it?  
Thank you.

---

<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 3, 2019, 8:26am UTC](https://discuss.elastic.co/t/how-to-set-the-value-of-total-fields-by-using-curl/198196/3 "2019-10-03T08:26:06Z")

</div>

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