Sonu Gupta
Sonu Gupta

Reputation: 367

How to put Elastic Search setting thru Curl command

I am trying to change the Elastic Search index setting to make it writable by curl command.

curl -XPUT http://1XX.xxx.xx9.xx0:9200/my_index/_settings
 { "index": { 
             "index.blocks.read_only" : false
             }
 }

But I am getting some error

curl: (3) [globbing] unmatched close brace/bracket in column 1

Upvotes: 0

Views: 3353

Answers (1)

Sunder R
Sunder R

Reputation: 1104

Try the following

curl -XPUT http://1XX.xxx.xx9.xx0:9200/my_index/_settings -H 'Content-Type: application/json' -d '{ "index": {"blocks.read_only" : false } }'

The above error is caused because in curl you have to provide the body using -d and enclosing everything in single quotes.

Upvotes: 2

Related Questions