Compressing ElasticSearch and extracting template settings


(Jeremy Schultz) #1

I am using the logstash's built-in ElasticSearch and I want to optimize the
storage used.

I have found the following on the Wiki:

If I Compress _source as shown below, will this setting still be present
after logstash(elasticsearch) has been restarted or will I need to re-apply
it?

curl -XPUT 'http://localhost:9200/_template/template_logstash/' -d '
{
"template": "logstash-*",
"mappings": {
"default": { "_source": { "compress": "true" } }
}
}'

Also is their a way to pull the current setting and/or templates that
logstash’s elasticsearch is using?


(Radu Gheorghe) #2

On Mar 1, 8:52 pm, Jeremy Schultz taoz...@gmail.com wrote:

I am using the logstash's built-in ElasticSearch and I want to optimize the
storage used.

I have found the following on the Wiki:https://github.com/logstash/logstash/wiki/Elasticsearch-Storage-Optim...

If I Compress _source as shown below, will this setting still be present
after logstash(elasticsearch) has been restarted or will I need to re-apply
it?

The settings should be persistent.

curl -XPUT 'http://localhost:9200/_template/template_logstash/'-d '
{
"template": "logstash-*",
"mappings": {
"default": { "_source": { "compress": "true" } }
}

}'

Also is their a way to pull the current setting and/or templates that
logstash’s elasticsearch is using?

Yes:
curl -XGET 'http://localhost:9200/_cluster/state?pretty=true'

The ?pretty=true part is optional, but pretty :smiley:


(system) #3