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

Deprecate document_type in filebeat 5.5 #4225

Merged
merged 1 commit into from
May 9, 2017
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
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
8 changes: 8 additions & 0 deletions filebeat/harvester/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package harvester

import (
"fmt"
"sync"
"time"

cfg "github.com/elastic/beats/filebeat/config"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}