# Retry: Pipeline to Pipeline Output Variable Expansion

**URL:** <https://discuss.elastic.co/t/retry-pipeline-to-pipeline-output-variable-expansion/208674>\
**Category:** Logstash\
**Created:** [November 20, 2019, 10:22am UTC](https://discuss.elastic.co/t/retry-pipeline-to-pipeline-output-variable-expansion/208674 "2019-11-20T10:22:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukas\_L](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@Lukas\_L](https://discuss.elastic.co/u/Lukas_L)\
**Post date:** [November 20, 2019, 10:22am UTC](https://discuss.elastic.co/t/retry-pipeline-to-pipeline-output-variable-expansion/208674/1 "2019-11-20T10:22:49Z")

</div>

Hello,

I have the same question as described in this post.

> [@Pipeline to Pipeline Output Variable Expansion](https://discuss.elastic.co/t/pipeline-to-pipeline-output-variable-expansion/179809):
>
> Hello, I'm trying to organize/refactor our Logstash (6.5.4) pipelines by using the Pipeline-to-Pipeline beta feature. We ingest a lot of custom log formats in addition to logs from the Filebeat (6.5.4) modules, so I have setup a forked-distributor pattern where our custom logs get sent to their own pipelines and the modules get sent to theirs (I've converted the Elasticsearch ingest pipelines for use by Logstash). Instead of writing each one out by hand (e.g. if [fileset][module] == "mysql" et…

Since there hasnt been any replies I thought i would just open the same topic again.  
I am currently using Logstash-7.3.1 with this configuration for all incoming data:

> output {  
> if [type] {  
> pipeline { send\_to =\> "%{[type]}" }  
> }  
> else {  
> pipeline { send\_to =\> "default" }  
> }  
> }

This is supposed to work like [The distributor pattern](https://www.elastic.co/guide/en/logstash/current/pipeline-to-pipeline.html#distributor-pattern), but without me having to add a "else if " statement for each new pipeline. My goal is that every event with a field called "type", should send their data to the matching pipeline (virtual address = type). Also if there is no type field defined it should go to the default pipeline.

However i am getting the following error:  
`Attempted to send event to '%{[type]}' but that address was unavailable. Maybe the destination pipeline is down or stopping? Will Retry.`

I appreciate any kind of feedback on this.

Thanks,  
Lukas L.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 20, 2019, 2:18pm UTC](https://discuss.elastic.co/t/retry-pipeline-to-pipeline-output-variable-expansion/208674/2 "2019-11-20T14:18:06Z")

</div>

You cannot use a sprintf reference in the name of a pipeline. pipeline connections are created at startup, not on-demand as events arrive.

---

<div class="post-metadata">

**Author:** ![Lukas\_L](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@Lukas\_L](https://discuss.elastic.co/u/Lukas_L)\
**Post date:** [November 20, 2019, 3:01pm UTC](https://discuss.elastic.co/t/retry-pipeline-to-pipeline-output-variable-expansion/208674/3 "2019-11-20T15:01:58Z")

</div>

Ok thanks.

Do you have any suggestions on how i could make the pipeline to pipeline communication more dynamic other than using what i have tried?

If not I will more or less have to stick to the multiple "if-statement method" right?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 20, 2019, 3:30pm UTC](https://discuss.elastic.co/t/retry-pipeline-to-pipeline-output-variable-expansion/208674/4 "2019-11-20T15:30:24Z")

</div>

I think your only option is a collection of if-else

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 18, 2019, 3:30pm UTC](https://discuss.elastic.co/t/retry-pipeline-to-pipeline-output-variable-expansion/208674/5 "2019-12-18T15:30:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
