Private
Private

Reputation: 1771

How to add slow log configuration in elasticsearch.yml?

In older version of elasticsearch the slowlog will be in elasticsearch.yml but for new version like 5.1.1 we have to add like slowlog configs like index.search.slowlog.threshold.query.debug: 0s index.search.slowlog.threshold.fetch.debug: 0s index.indexing.slowlog.threshold.index.debug: 0s

I tried adding these configs in my elasticsearch.yml,when i started the elasticsearch service it is not starting it is throwing an error.

Can anyone help me to solve this problem?

Upvotes: 0

Views: 1873

Answers (1)

Foster
Foster

Reputation: 29

Since Elasticsearch 5, slow log settings are for each indices.

You can PUT the settings to a specific index /index_name/_settings

with a payload like the following. More details are available at Elasticsearch Reference

{
"index.search.slowlog.threshold.query.warn": "10s",
"index.search.slowlog.threshold.query.info": "5s",
"index.search.slowlog.threshold.query.debug": "2s",
"index.search.slowlog.threshold.query.trace": "300ms",
"index.search.slowlog.threshold.fetch.warn": "1s",
"index.search.slowlog.threshold.fetch.info": "800ms",
"index.search.slowlog.threshold.fetch.debug": "500ms",
"index.search.slowlog.threshold.fetch.trace": "300ms",
"index.indexing.slowlog.threshold.index.warn": "10s",
"index.indexing.slowlog.threshold.index.info": "5s",
"index.indexing.slowlog.threshold.index.debug": "2s",
"index.indexing.slowlog.threshold.index.trace": "300ms",
"index.indexing.slowlog.level": "trace",
"index.indexing.slowlog.source": "1000"
}

Upvotes: 2

Related Questions