# LOGSTASH AND PIPELINE

**URL:** https://discuss.elastic.co/t/logstash-and-pipeline/158544
**Category:** Logstash
**Created:** [November 28, 2018, 10:36am UTC](https://discuss.elastic.co/t/logstash-and-pipeline/158544 "2018-11-28T10:36:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shruti51](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@shruti51](https://discuss.elastic.co/u/shruti51)
#### Post date: [November 28, 2018, 10:36am UTC](https://discuss.elastic.co/t/logstash-and-pipeline/158544/1 "2018-11-28T10:36:33Z")

</div>

Hi,

I am using distributor approch for two usecases.My config is:

# config/pipelines.yml

pipeline.id: beats2  
config.string: |  
input {  
file {  
path =\> "/opt/webmis/ELKFMDOFMSDKLFJAVA/GA/guyubdjsanbticleGlobal/_.txt"  
start\_position =\> "beginning"  
add\_field =\> ["log\_type","FA-SAP"]  
}  
file {  
path =\> "/opt/webmis/ELNFJKDHFKDN\_JAVA/YA/IDoc\_OutboundArticleLocal/_.txt"  
start\_position =\> "beginning"  
add\_field =\> ["log\_type","LA-SOP"]  
}  
}  
output {  
if [log\_type] == FA-SAP {  
pipeline { send\_to =\> beats9}  
} else if [log\_type] == LA-SOP{  
pipeline { send\_to =\> beats10}  
}  
}

i am getting error in logstash logs as:  
[2018-11-28T10:15:46,341][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:beats2, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of #, input, filter, output at line 2, column 1 (byte 25) after # config/pipelines.yml\r\n", :backtrace=\>["/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/compiler.rb:42:in `compile_imperative'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/compiler.rb:50:in`compile\_graph'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/compiler.rb:12:in `block in compile_sources'", "org/jruby/RubyArray.java:2486:in`map'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/compiler.rb:11:in `compile_sources'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/pipeline.rb:51:in`initialize'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/pipeline.rb:169:in `initialize'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/pipeline_action/create.rb:40:in`execute'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:315:in `block in converge_state'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:141:in`with\_pipelines'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:312:in `block in converge_state'", "org/jruby/RubyArray.java:1734:in`each'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:299:in `converge_state'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:166:in`block in converge\_state\_and\_update'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:141:in `with_pipelines'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:164:in`converge\_state\_and\_update'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:105:in `block in execute'", "/opt/webmis/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/interval.rb:18:in`interval'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/agent.rb:94:in `execute'", "/opt/webmis/logstash-6.2.4/logstash-core/lib/logstash/runner.rb:348:in`block in execute'", "/opt/webmis/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}

Please help.  
I am working with centralized pipeline.

---

<div class="post-metadata">

### Author: ![Eniqmatic](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@Eniqmatic](https://discuss.elastic.co/u/Eniqmatic)
#### Post date: [November 28, 2018, 11:53am UTC](https://discuss.elastic.co/t/logstash-and-pipeline/158544/2 "2018-11-28T11:53:23Z")

</div>

You should follow this format:

```
- pipeline.id: my-pipeline_1
  path.config: "/etc/path/to/p1.config"
  pipeline.workers: 3
- pipeline.id: my-other-pipeline
  path.config: "/etc/different/path/p2.cfg"
  queue.type: persisted

```

Also you have a missing hyphon in your configuration at the start before "pipeline.id"

---

<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 26, 2018, 11:53am UTC](https://discuss.elastic.co/t/logstash-and-pipeline/158544/3 "2018-12-26T11:53:28Z")

</div>

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