-
Notifications
You must be signed in to change notification settings - Fork 349
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
feat: filter & rename processor support v2 model #1233
base: main
Are you sure you want to change the base?
Conversation
snakorse
commented
Nov 13, 2023
- filter processor support v2 model:
- for log event, filter tags and content keys
- for other event, filter tags
- rename processor support v2 model:
- for log event, add support for rename tags
contents.Add(newKey, contents.Get(oldKey)) | ||
contents.Delete(oldKey) | ||
} else if p.NoKeyError { | ||
case tags.Contains(oldKey): |
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.
不合理,不要把字段和tag混在一起处理,应该单独做一个TagRename
tags := event.GetTags().Iterator() | ||
contents := event.Contents.Iterator() | ||
for key, reg := range p.includeRegex { | ||
if v, ok := tags[key]; ok && reg.MatchString(v) { |
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.
不要处理tags,log的tag没有良好定义,并且和group的tag太容易混乱
nextIdx := 0 | ||
for idx := 0; idx < totalLen; idx++ { | ||
if p.isEventMatch(in.Events[idx]) { | ||
if idx != nextIdx { |
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.
这么写看起来是复杂了,性能如果没有实际测试过会更好的话,就画蛇添足了