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

rename json property after deserialization (json type) #370

Open
Toaster2-0 opened this issue Feb 11, 2023 · 0 comments
Open

rename json property after deserialization (json type) #370

Toaster2-0 opened this issue Feb 11, 2023 · 0 comments

Comments

@Toaster2-0
Copy link

Toaster2-0 commented Feb 11, 2023

Hello,

Summary
I would like to be able to change the result propertynames of the json type after deserialization.

example configuration
rule=:%[{"type": "json", "name": "json", "property": {"log.level": "servity", "servity": "servity"}]%

Problemdescription
I am using rsyslog mainly for logging the logs of docker, because docker can only decide the servity based on where it came from (stderr or stdout), I try to get the servity from the log message. Some program logs are put out in json. When i use mmnormalize I can only take the property names of the original jsonobject.
For that it would be helpful to be able to cange the propertyname after deserialization (of course only of specified properties).

Workaround
Another possibility would be to check if the jsonproperty exists after deserialization and then change the property. But I think it fits better in the normalization part.

Please share your opinion and Thanks for reading.

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