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

feat: filter & rename processor support v2 model #1233

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

snakorse
Copy link
Collaborator

  1. filter processor support v2 model:
  • for log event, filter tags and content keys
  • for other event, filter tags
  1. 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):
Copy link
Collaborator

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) {
Copy link
Collaborator

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这么写看起来是复杂了,性能如果没有实际测试过会更好的话,就画蛇添足了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants