It is not possible, the send_to option does not support sprintf expansion, so it will try to output to a pipeline with the literal name of %{[metadata][output_id]}.
You will need to use the if else conditions, but I don't think this will have any considerable impact in the performance.
I do not have any benchmarks about this case, but I've run pipelines with many if/else conditions in the output without any impact, a single grok filter probably has more impact in the performance than many simple conditionals check.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.