# Unable to merge pipelines in logstash

**URL:** <https://discuss.elastic.co/t/unable-to-merge-pipelines-in-logstash/160344>\
**Category:** Logstash\
**Created:** [December 11, 2018, 10:18am UTC](https://discuss.elastic.co/t/unable-to-merge-pipelines-in-logstash/160344 "2018-12-11T10:18:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivek\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_sharma/32/46948_2.png) [@Vivek\_Sharma](https://discuss.elastic.co/u/Vivek_Sharma)\
**Post date:** [December 11, 2018, 10:18am UTC](https://discuss.elastic.co/t/unable-to-merge-pipelines-in-logstash/160344/1 "2018-12-11T10:18:32Z")

</div>

Hi

I am using Logstash version 6.2.4

I am trying to merge pipelines as below:

Master pipeline/Merged Pipeline:

```
# config/pipelines.yml
- pipeline.id: beats1
  config.string: |
    input { 
	file { 
			path => "/XXXXX/*.txt"
			start_position => "beginning"
			add_field => [log_type, "Beat-2"]
		}
	file { 
			path => "/YYYYY/*.txt"
			start_position => "beginning"
			add_field => [log_type, "Beat-3"]
		}
	}
    output {
        if [log_type] == "Beat-2" {
          pipeline { send_to => beats2 }
        } 
		if [log_type] == "Beat-3" {
          pipeline { send_to => beats3 }
        }
    }

```

Code in my beats 2 is as below:

```
- pipeline.id: beats2
  config.string: |
    input { pipeline { address => beats2 } }
    filter {
       # my fileter logic here to parse the data
    }
    output {
      elasticsearch { ## my output server details here }
    }

```

Code in my beats 3 is as below

```
- pipeline.id: beats3
  config.string: |
    input { pipeline { address => beats3 } }
    filter {
       # my filter logic here to parse the data
    }
    output {
      elasticsearch { ## my output server details here }
    }

```

I am deploying these pipelines by going: **Kibana Console -\> Management -\> Logstash -\> Pipeline (Using Centralized Pipeline Configuration)**

But when I look at logstash logs, I get error **"Expected one of #, input, filter, output at line 1, column 1"**

This same error is coming against each of these pipelines.

I also checked if pipeline to pipeline communication(distributor pattern) is possible or not on version 6.2.4 but could not find any documentation for that.

Can anyone please help me in resolving this issue.

Can anyone please help me.

Thanks

---

<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:** [January 8, 2019, 10:18am UTC](https://discuss.elastic.co/t/unable-to-merge-pipelines-in-logstash/160344/2 "2019-01-08T10:18:34Z")

</div>

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