-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Use IndexPrefix for kafka and logstash output. #10841
Conversation
libbeat/outputs/logstash/logstash.go
Outdated
@@ -46,7 +46,7 @@ func makeLogstash( | |||
cfg *common.Config, | |||
) (outputs.Group, error) { | |||
if !cfg.HasField("index") { | |||
cfg.SetString("index", -1, beat.Beat) | |||
cfg.SetString("index", -1, beat.IndexPrefix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should separate config unpacking into a separate function and create tests (file config_test.go
) for config unpacking edge cases.
common pattern:
func readConfig(in *common.Config) (Config, error) {
...
}
Thanks for adding tests. Run |
Output index differed to Elasticsearch output. fixes elastic#10839
f7cad52
to
c709710
Compare
@urso I update the license headers. Failing test seems unrelated afaics. |
I restarted the Travis one. At least one should be green. |
jenkins, retest this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
travis has been green. beats-ci failures due to network failures in tests, but unrelated to this change. Kafka + LS tests passed on all CI systems.
Output index differed to Elasticsearch output. fixes elastic#10839
Output index differed to Elasticsearch output. fixes elastic#10839
Writing to ES output libbeat falls back to use
beat.Info.IndexPrefix
as default index, if nothing else is configured. Using logstash or kafka, libbeat usesbeat.Info.Beat
as default index.In case
IndexPrefix
andBeat
is not the same, the resulting index in ES differs.This PR intends to fix this inconsistency.
fixes #10839