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

[processor/logdedup] Use a specific field as deduplication key #36965

Open
mauri870 opened this issue Dec 26, 2024 · 4 comments
Open

[processor/logdedup] Use a specific field as deduplication key #36965

mauri870 opened this issue Dec 26, 2024 · 4 comments
Labels
enhancement New feature or request processor/logdedup

Comments

@mauri870
Copy link
Contributor

mauri870 commented Dec 26, 2024

Component(s)

processor/logdedup

Is your feature request related to a problem? Please describe.

Currently the processor uses the entire log message as the deduplication key, allowing the user to remove certain fields from being considered during the hashing part via the exclude_fields option.

One scenario that is not covered is that the deduplication key could be already present as a body or attribute in the log message. You could exclude the other body and attributes via exclude_fields, but this negative match is very error prone and does not scale well.

Describe the solution you'd like

I propose we add a new option to use a certain LogRecord field as deduplication key. This option accepts ottl style path variables:

processors:
    logdedup:
        key:  body["my_id_field"]

Describe alternatives you've considered

No response

Additional context

No response

@mauri870 mauri870 added enhancement New feature or request needs triage New item requiring triage labels Dec 26, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski djaglowski removed the needs triage New item requiring triage label Jan 6, 2025
@djaglowski
Copy link
Member

Makes sense to me.

@djaglowski
Copy link
Member

I suggest we use ottl style references to fields: body["foo"] instead of body.foo

@mauri870
Copy link
Contributor Author

mauri870 commented Jan 7, 2025

@djaglowski Do you have any resources on how to evaluate the OTTL string from the field? I'm struggling to follow up on this part. For example, I have a LogRecord and an OTTL string like body["my_field"] and I need to extract the actual value from the LogRecord. I’d appreciate any help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request processor/logdedup
Projects
None yet
Development

No branches or pull requests

2 participants