diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 69cb5646639..40abc593edb 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -49,6 +49,7 @@ https://github.com/elastic/beats/compare/v6.5.0...6.x[Check the HEAD diff] - Log events at the debug level when dropped by encoding problems. {pull}9251[9251] - Refresh host metadata in add_host_metadata. {pull}9359[9359] - When collecting swap metrics for beats telemetry or system metricbeat module handle cases of free swap being bigger than total swap by assuming no swap is being used. {issue}6271[6271] {pull}9383[9383] +- Ignore non index fields in default_field for Elasticsearch. {pull}9549[9549] - Update Golang to 1.10.6. {pull}9563[9563] *Auditbeat* diff --git a/libbeat/template/processor.go b/libbeat/template/processor.go index 32399b5fbb8..e0fbc9e8025 100644 --- a/libbeat/template/processor.go +++ b/libbeat/template/processor.go @@ -167,7 +167,9 @@ func (p *Processor) keyword(f *common.Field) common.MapStr { fullName = f.Path + "." + f.Name } - defaultFields = append(defaultFields, fullName) + if f.Index == nil || (f.Index != nil && *f.Index) { + defaultFields = append(defaultFields, fullName) + } property["type"] = "keyword" @@ -201,7 +203,9 @@ func (p *Processor) text(f *common.Field) common.MapStr { fullName = f.Path + "." + f.Name } - defaultFields = append(defaultFields, fullName) + if f.Index == nil || (f.Index != nil && *f.Index) { + defaultFields = append(defaultFields, fullName) + } properties["type"] = "text"