Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #20218 to 7.9: Increase index.max_docvalue_fields_search to 200 #20221

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,19 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add keystore support for autodiscover static configurations. {pull]16306[16306]
- When using the `decode_json_fields` processor, decoded fields are now deep-merged into existing event. {pull}17958[17958]
- Add keystore support for autodiscover static configurations. {pull]16306[16306]
- Add backoff configuration options for the Kafka output. {issue}16777[16777] {pull}17808[17808]
- Add TLS support to Kerberos authentication in Elasticsearch. {pull}18607[18607]
- Change ownership of files in docker images so they can be used in secured environments. {pull}12905[12905]
- Upgrade k8s.io/client-go and k8s keystore tests. {pull}18817[18817]
- Add support for multiple sets of hints on autodiscover {pull}18883[18883]
- Add a configurable delay between retries when an app metadata cannot be retrieved by `add_cloudfoundry_metadata`. {pull}19181[19181]
- Add data type conversion in `dissect` processor for converting string values to other basic data types. {pull}18683[18683]
- Add the `ignore_failure` configuration option to the dissect processor. {pull}19464[19464]
- Add the `overwrite_keys` configuration option to the dissect processor. {pull}19464[19464]
- Add support to trim captured values in the dissect processor. {pull}19464[19464]
- Added the `max_cached_sessions` option to the script processor. {pull}19562[19562]
- Add support for DNS over TLS for the dns_processor. {pull}19321[19321]
- Set index.max_docvalue_fields_search in index template to increase value to 200 fields. {issue}20215[20215]

*Auditbeat*

Expand Down
11 changes: 8 additions & 3 deletions libbeat/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ import (

var (
// Defaults used in the template
defaultDateDetection = false
defaultTotalFieldsLimit = 10000
defaultNumberOfRoutingShards = 30
defaultDateDetection = false
defaultTotalFieldsLimit = 10000
defaultNumberOfRoutingShards = 30
defaultMaxDocvalueFieldsSearch = 200

// Array to store dynamicTemplate parts in
dynamicTemplates []common.MapStr
Expand Down Expand Up @@ -325,6 +326,10 @@ func buildIdxSettings(ver common.Version, userSettings common.MapStr) common.Map
indexSettings.Put("query.default_field", fields)
}

if ver.Major >= 6 {
indexSettings.Put("max_docvalue_fields_search", defaultMaxDocvalueFieldsSearch)
}

indexSettings.DeepUpdate(userSettings)
return indexSettings
}
Expand Down
3 changes: 3 additions & 0 deletions libbeat/template/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,23 @@ func TestTemplate(t *testing.T) {
template.Assert("index_patterns", []string{"testbeat-" + currentVersion + "-*"})
template.Assert("order", 1)
template.Assert("mappings.doc._meta", common.MapStr{"beat": "testbeat", "version": currentVersion})
template.Assert("settings.index.max_docvalue_fields_search", 200)
})

t.Run("for ES 7.x", func(t *testing.T) {
template := createTestTemplate(t, currentVersion, "7.2.0", DefaultConfig())
template.Assert("index_patterns", []string{"testbeat-" + currentVersion + "-*"})
template.Assert("order", 1)
template.Assert("mappings._meta", common.MapStr{"beat": "testbeat", "version": currentVersion})
template.Assert("settings.index.max_docvalue_fields_search", 200)
})

t.Run("for ES 8.x", func(t *testing.T) {
template := createTestTemplate(t, currentVersion, "8.0.0", DefaultConfig())
template.Assert("index_patterns", []string{"testbeat-" + currentVersion + "-*"})
template.Assert("order", 1)
template.Assert("mappings._meta", common.MapStr{"beat": "testbeat", "version": currentVersion})
template.Assert("settings.index.max_docvalue_fields_search", 200)
})
}

Expand Down