don't you have kibana?
from there you can run the PUT api call directly from Dev tool.
If not then run curl command like :
curl -XPUT "http://<your cluster ip or fqdn>:9200/_template/my_template" -H 'Content-Type: application/json' -d'{ "index_patterns": ["*"], "settings": { "index": { "codec": "best_compression" } }, "mappings" : { "_source": { "excludes": [ ] } }}'
once you run the above command all your new indices will have best compression.
If you want to do it for the existing index then you will need to close it first and then change compression setting and then open the index.
something like this:
- Close all indices:http://localhost:9200/_all/_close'
- Apply best_compression to all curl -XPUT 'http://localhost:9200/_all/_settings' -d '{"index.codec" : "best_compression"}'
- Open all indices: curl -XPOST 'http://localhost:9200/_all/_open'