-
I have an http_client source that returns a dynamic JSON object and I am using a transform to collect the items I need and store them in an array. I then need to iterate over that array and make multiple http_client source requests with each value in the array. I apologize, but I am not clear about the proper way to reuse results from VRL on subsequent source calls. Can I make new source requests after the transform again? I can't invoke a source request from inside the transform can I? Is it better to use a scripting language to make the first request, get the array, and then invoke vector for each item in the array? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
If I understand correctly, you want to make HTTP requests over the network from within a Remap transform, with is not doable for various reasons. The cleanest way here is to ensure your source outputs individual events, ready to be processed by VRL. I don't have the full context here but you could modify the API or use an ad-hoc script like you describe. |
Beta Was this translation helpful? Give feedback.
One way to introduce this sort of feature into Vector, I think, would be an "HTTP enrichment table", but it would diverge quite a bit from existing enrichment tables in that the fetching of state would need to be dynamic. Current enrichment tables load the data into memory at start-time to avoid slow processing.
Absent that, I think a Lua transform might be able to be used here. You can execute arbitrary operations in a Lua transform (like issuing HTTP requests).