-
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
Address issue #10505 (add_kubernetes_metadata processor matcher not working) #10506
Conversation
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.
I think there are some test case(s) that need updated in
Good catch. fixed this. |
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.
LGTM.
@alakahakai Thank you for the fix. |
@@ -77,9 +77,9 @@ const containerIdLen = 64 | |||
const podUIDPos = 5 | |||
|
|||
func (f *LogPathMatcher) MetadataIndex(event common.MapStr) string { | |||
if value, ok := event["source"]; ok { | |||
if value, ok := event["log"].(common.MapStr)["file"].(common.MapStr)["path"]; ok { |
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.
This line probably breaks with the redis input as it does not have the fields in here.
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.
@alakahakai I think using event.Get("log.file.path")
should be safe w.r.t. #11543 (comment).
add_kubernetes_metadata processor is broken because it uses old field source for lookup. Use log.file.path for matcher.