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

Add headers for parse_csv #130

Open
vladimir-dd opened this issue Mar 29, 2021 · 3 comments
Open

Add headers for parse_csv #130

vladimir-dd opened this issue Mar 29, 2021 · 3 comments
Labels
type: feature A value-adding code addition that introduce new functionality. vrl: stdlib Changes to the standard library

Comments

@vladimir-dd
Copy link
Contributor

As a follow-up on vectordotdev/vector#5371 we should add an option to set headers for the parse_csv function, for example:

parse_csv!("foo,bar", headers: ["header1", "header2"])
// { "header1": "foo", "header2": "bar" }
@vladimir-dd vladimir-dd added the type: feature A value-adding code addition that introduce new functionality. label Mar 29, 2021
@jszwedko
Copy link
Member

@jerome-kleinen-kbc-be
Copy link

Similarly this could be relevant for parse_tokens. You could also consider generalising this using a VRL function that takes two arrays, one with keys and one with values, that returns an object. This generic function could do some checks on array lengths etc.

@jszwedko jszwedko added the vrl: stdlib Changes to the standard library label Dec 28, 2022
@fuchsnj fuchsnj transferred this issue from vectordotdev/vector Mar 28, 2023
@bruceg
Copy link
Member

bruceg commented Dec 19, 2024

Noting here that the PRs associated with #1157 solve most of this, though it may be more efficient to handle it in parse_csv directly.

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

4 participants