-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Allow renaming keys added by CallsiteParameterAdder #553
Comments
This would be handy. My use-case is conforming to the field names expected by Elastic: My (planned) workaround is to have a renaming processor to do a final mapping of names to the ECS equivalents. |
Would be handy for us as well, we have an org-wide Datadog log ingest pipeline, that maps threadName for python apps, would appreciate this renaming ability for any keys in the JSON output. |
You can build this trivially yourself: renames = {
"foo": "bar"
}
sentinel = object()
def conform(_, __, ed):
for key in renames.keys():
if (val := ed.pop(key, sentinel)) is not sentinel:
ed[renames[key]] = val
return ed >>> conform(None, None, {"foo": 42, "unrelated": 420})
{'unrelated': 420, 'bar': 42} |
Thanks for the snippet, but I'd like to see something like EventRenamer expanded for any arbitrary mapping, and that would become a general remapping rather than just for event, so they are within the same processor, but this is more of a nit request. |
Currently,
CallsiteParameterAdder
always adds each parameter under a predetermined key. It would be nice if the user can specify an alternate key for each parameter instead.A pretty simple to implement and fully backwards compatible way would be to change the init method from
to
The user can then instantiate the processor as
The text was updated successfully, but these errors were encountered: