VRL: coerce string into array #21075
Unanswered
ADovgalyuk
asked this question in
Q&A
Replies: 2 comments
-
I think the best approach here should be that the arrays are json-compatible If you can't change the origin format of those arrays, maybe you can preprocess the string value with |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks @jorgehermo9 . I agree that that seems like a good approach. I'll convert this to a discussion since it isn't really an bug report or feature request (at least not yet). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A note for the community
Use Cases
Hello everyone!
I have a csv file where some fields can be either empty or array. For example:
I'm using function parse_csv that results in array with strings inside, but array fields from csv are also doublequoted as strings.
Code:
Result
I want to coerce value back to Array from String, because they have incorrect type after VRL transforms.
Thanks for the help in advance!
Attempted Solutions
I do understand that I can do it via Lua script or with additional string manipulations, but still it's better and more "clean" to do it as additional function.
Proposal
No response
References
Based on discussion
Version
0.40.0
Beta Was this translation helpful? Give feedback.
All reactions