Closed evanzhang87 closed 1 month ago
Hi @evanzhang87 ,
Am I understanding correctly that you want to use flatten
but only have it flatten one level? The title of this issue is a bit confusing.
Sorry, I want to make a json string
value, like {\"key_l3\": \"hello\"}"
, my value is from a multi level json, so I want to flatten
one level, but it's not so important, because I can use vrl
: .keyl1_l2 = .keyl1.l2
。
Ah, you can turn an object into a JSON string via https://vector.dev/docs/reference/vrl/functions/#encode_json . Is that what you mean?
Wow, it works! thx~
A note for the community
Use Cases
For multi level json message, I want to
flatten
only just one level, like this:But I think it's more common to convert object to string.
Attempted Solutions
No response
Proposal
No response
References
No response
Version
No response