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

[pkg/ottl] Add merge_all_maps #32954

Open
strawgate opened this issue May 8, 2024 · 6 comments
Open

[pkg/ottl] Add merge_all_maps #32954

strawgate opened this issue May 8, 2024 · 6 comments
Labels
enhancement New feature or request pkg/ottl

Comments

@strawgate
Copy link
Contributor

strawgate commented May 8, 2024

Component(s)

No response

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

Right now merge_maps requires a source map and a target map.

There does not seem to be a good way to merge an array of maps.

Describe the solution you'd like

merge_all_maps(source, target, method)

where source is an array of maps and target is a map

Method (or whatever it's called on merge_map) would decide whether it's an insert, upset, etc

Describe alternatives you've considered

No response

Additional context

No response

@strawgate strawgate added enhancement New feature or request needs triage New item requiring triage labels May 8, 2024
Copy link
Contributor

github-actions bot commented May 8, 2024

Pinging code owners:

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

@evan-bradley
Copy link
Contributor

@TylerHelmuth How would you feel about changing the source parameter in merge_maps to a list instead of a single value? This would be a huge breaking change, but would let us avoid having two editors. Maybe we could find a way to have a transition period.

@TylerHelmuth
Copy link
Member

We could add a third, optional parameter like additionalMaps that is a list.

Technically the solution to this issue right now is to have multiple merge_maps statements in a row.

@strawgate
Copy link
Contributor Author

I think the issue is that with things like Windows event data there are an arbitrary number of maps present in the array

@TylerHelmuth
Copy link
Member

@strawgate interesting, can you go into more details about that use case?

@strawgate
Copy link
Contributor Author

I detailed it here: #32952

Happy to include more info if you have specific questions

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

No branches or pull requests

3 participants