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

Replace Nest Key #73

Open
ruiminhu opened this issue Jul 10, 2023 · 0 comments
Open

Replace Nest Key #73

ruiminhu opened this issue Jul 10, 2023 · 0 comments

Comments

@ruiminhu
Copy link

ruiminhu commented Jul 10, 2023

Hey @repeatedly , I want to redact my value, the key is nested.
However, just some record has both 2 level of nested keys.
{
"properties": {
"messageTracingId": 12345,
"connectionId": "ABCDE",
"traceId": "akhsb:01",
"hub": "chatsamplehub",
"userId": "eyJAdlhopWkXY.eyJuKXE4gp4QP.hlGrujNIvT"
},
"resourceId": "balabal",
"time": "2023-07-10T10:45:29Z"
}

I want to replace value of the [properties][userId], if it's pattern match. But not every record has properties and not each properties has userId.
How should I check before I do the following?

filter mdsdlog.asrs.customer>
@type record_modifier

expression /(?-i)eyJ(?i)[a-z0-9\-_%]+\.(?-i)eyJ(?i)[a-z0-9\-_%]+\.[a-z0-9\-_%]+/ key **$.properties.userId** replace "[REDACTED]"
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

No branches or pull requests

1 participant