Closed
Description
Elasticsearch version : Tested with 6.6.1 and master
Description of the problem including expected versus actual behavior:
Slowlog settings are supposed to be per index. However, setting the slowlog settings for an index, override the respective settings in all other indices, even when these other settings have been previously configured.
Steps to reproduce:
- Create index
test_1
and setindex.search.slowlog.level: warn
andindex.search.slowlog.threshold.query.trace
to 0.
curl -X PUT -H 'Content-Type: application/json' 'http://localhost:9200/test_1/_settings' -d '{"settings": {"index.search.slowlog.level": "warn", "index.search.slowlog.threshold.query.trace": 0}}'
Get the settings to verify it is set correctly
curl -uelastic:password -X GET 'http://localhost:9200/test_1/_settings'
should return
...
"test_1" : {
"settings" : {
"index" : {
"search" : {
"slowlog" : {
"level" : "warn",
"threshold" : {
"query" : {
"trace" : "0"
}
}
}
},
...
- Make a few searches
curl -X GET 'http://localhost:9200/test_1/_search'
and verify nothing is printed in the *.index_search_slowlog.log
- Create index
test_2
and setindex.search.slowlog.level: trace
andindex.search.slowlog.threshold.query.trace
to 0.
curl -X PUT -H 'Content-Type: application/json' 'http://localhost:9200/test_2/_settings' -d '{"settings": {"index.search.slowlog.level": "warn", "index.search.slowlog.threshold.query.trace": 0}}'
Get the settings to verify it is set correctly
curl -uelastic:password -X GET 'http://localhost:9200/test_2/_settings'
should return
...
"test_2" : {
"settings" : {
"index" : {
"search" : {
"slowlog" : {
"level" : "trace",
"threshold" : {
"query" : {
"trace" : "0"
}
}
}
},
...
Verify also that the settings for test_1
have not been changed ( at least that's reported ):
curl -uelastic:password -X GET 'http://localhost:9200/test_1/_settings'
should still return
...
"test_1" : {
"settings" : {
"index" : {
"search" : {
"slowlog" : {
"level" : "warn",
"threshold" : {
"query" : {
"trace" : "0"
}
}
}
},
...
- Make a search in
test_1
again
curl -X GET 'http://localhost:9200/test_1/_search'
Observe log lines such as
[2019-05-23T13:27:38,633][TRACE][i.s.s.query ] [node-0] [test_1][0] took[218.5micros], took_millis[0], total_hits[0 hits], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[1], source[{}], id[],
in the *.index_search_slowlog.log