Dynamic routing in one thread #23019
-
Hello. I need to send route data in one thread based on the identifier. Now my configuration looks like this: [transforms.route_by_id]
type = "route"
inputs = ["remap_log"]
route.id1 = '.terminal_id == "1"'
route.id2 = '.terminal_id == "2"'
route.id3 = '.terminal_id == "3"' Next I create a sink file for each route: [sinks.http-out-id1]
type = "http"
inputs = ["route_by_id.id1"]
uri = "http://localhost:6002/event"
method = "post"
encoding.codec = "json"
request.concurrency = 1 Is there any way to improve such a configuration? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Depending on your use case I might switch from Route to Exclusive Route then order the different streams based on how often you expect to see data from each id most frequent at the top to least at the bottom. Reason: route will evaluate all conditions and send the data to more then 1 if there is a match were exclusive route will only send it out one path the first to match so if you having to process less far each event it would technically be improved performance wise. As far dynamic routing I actually have such a feature request open, please go up vote. :) |
Beta Was this translation helpful? Give feedback.
Depending on your use case I might switch from Route to Exclusive Route then order the different streams based on how often you expect to see data from each id most frequent at the top to least at the bottom.
Reason: route will evaluate all conditions and send the data to more then 1 if there is a match were exclusive route will only send it out one path the first to match so if you having to process less far each event it would technically be improved performance wise.
As far dynamic routing I actually have such a feature request open, please go up vote. :)