8000 Add option for VRL function parse_key_value to specify resulting key case · Issue #1313 · vectordotdev/vrl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Add option for VRL function parse_key_value to specify resulting key case #1313

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

Open
alexeynl opened this issue Mar 3, 2025 · 4 comments
Open
Labels
type: feature A value-adding code addition that introduce new functionality. vrl: stdlib Changes to the standard library

Comments

@alexeynl
Copy link
alexeynl commented Mar 3, 2025

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

Lets we have the following strings:

key1=value1,key2=value2
Key1=value1,Key2=value2

In current implementation using

result = parse_key_value(string)

i need check both

result.key1
result.Key1

for value.

Attempted Solutions

No response

Proposal

If i have keys in key value string contains in different cases i need option to specify case of resulting field names like this:

result = parse_key_value(string, key_case: "low")

result.key1 must return value1 for both string:

key1=value1,key2=value2
Key1=value1,Key2=value2

References

No response

Version

No response

@alexeynl alexeynl added the type: feature A value-adding code addition that introduce new functionality. label Mar 3, 2025
@alexeynl alexeynl changed the title Add option for VRL function parse_key_value specify key case Add option for VRL function parse_key_value to specify key case Mar 3, 2025
@alexeynl alexeynl changed the title Add option for VRL function parse_key_value to specify key case Add option for VRL function parse_key_value to specify resulting key case Mar 3, 2025
@pront pront added the vrl: stdlib Changes to the standard library label Mar 3, 2025
@pront pront transferred this issue from vectordotdev/vector Mar 3, 2025
@pront
Copy link
Member
pront commented Mar 3, 2025

Hello, can you share a playground example?

@JakubOnderka
Copy link
Contributor

@alexeynl

You can normalize keys by this simple approach:

ldap_dn = map_keys(ldap_dn, recursive: true) -> |key| { downcase(key) }

@alexeynl
Copy link
Author
alexeynl commented Mar 4, 2025

@alexeynl

You can normalize keys by this simple approach:

ldap_dn = map_keys(ldap_dn, recursive: true) -> |key| { downcase(key) }

This works. Thank you!

I have tried similar with for_each but no luck...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A value-adding code addition that introduce new functionality. vrl: stdlib Changes to the standard library
Projects
None yet
Development

No branches or pull requests

3 participants
0