diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 97aa7aeddfe..7d510e94137 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -73,6 +73,7 @@ https://github.com/elastic/beats/compare/v5.3.0...master[Check the HEAD diff] *Affecting all Beats* *Filebeat* +- Deprecate `document_type` prospector config option as _type is removed in elasticsearch 6.0. Use fields instead. {pull}4225[4225] *Heartbeat* diff --git a/filebeat/docs/reference/configuration/filebeat-options.asciidoc b/filebeat/docs/reference/configuration/filebeat-options.asciidoc index 9e26fb8b083..ce026cc1151 100644 --- a/filebeat/docs/reference/configuration/filebeat-options.asciidoc +++ b/filebeat/docs/reference/configuration/filebeat-options.asciidoc @@ -296,6 +296,8 @@ The default setting is 10s. ===== document_type +deprecated[5.5,Use `fields` instead] + The event type to use for published lines read by harvesters. For Elasticsearch output, the value that you specify here is used to set the `type` field in the output document. The default value is `log`. diff --git a/filebeat/harvester/config.go b/filebeat/harvester/config.go index 67668b6a140..f81e8e83200 100644 --- a/filebeat/harvester/config.go +++ b/filebeat/harvester/config.go @@ -2,6 +2,7 @@ package harvester import ( "fmt" + "sync" "time" cfg "github.com/elastic/beats/filebeat/config" @@ -57,6 +58,8 @@ type harvesterConfig struct { Fileset string `config:"_fileset_name"` // hidden option to set the fileset name } +var onceCheck sync.Once + func (config *harvesterConfig) Validate() error { // DEPRECATED: remove in 6.0 @@ -87,5 +90,10 @@ func (config *harvesterConfig) Validate() error { return fmt.Errorf("When using the JSON decoder and line filtering together, you need to specify a message_key value") } + if config.DocumentType != "log" { + onceCheck.Do(func() { + logp.Warn("DEPRECATED: document_type is deprecated. Use fields instead.") + }) + } return nil }