Convert Logstash Main pipeline to multiple pipelines

Hello team,
I have a main pipeline that has multiple inputs like beats, kafka and filters for many application and single and big output file with many if, else if and else.

The pipeline is so messed now and am not certain if I add any more else if to my output its being processed.

I want to convert to multiple pipelines where I want to separate based on apps. This is what I understood after reading documents

  1. Create pipelines.yml
- app1
  path.config: "app1.config"
- app2
  path.config: "app2.config"
- app3
  path.config: "app3.config"
  1. create app1.config
filter{if XXX then ...}
  1. create app2.config
filter{if XXX then ...}
  1. create app3.config
filter{if XXX then ...}

Please help me if this is correct and also if you have any documentation on how to start converting... Can I just go ahead and start creating these files by taking out one configuration at a time or any process to follow. Please guide me.

Yes, that looks correct. I would suggest you do change only one configuration at a time.

So here is what I have

[2022-11-15T18:30:28,967][ERROR][logstash.agent           ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \\t\\r\\n], \"#\", \"input\", \"filter\", \"output\" at line 1, column 1 (byte 1)", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/ `initialize'", "org/logstash/execution/ `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:365:in `block in converge_state'"]}

I run Logstash on docker and mount a volume with pipelines.

okay... one thing I messed up was the pipelines.yml location is in config but not configs. Simple typo caused this error. To summarize for others

and pipeline configurations in 

Restart of docker is needed. FYI

However @Badger, need your help. I am unable to make changes to the pipelines. Restarted the docker many times and also added following configuration still it wont change.

- name: starting elasticsearch logstash container 1
      become: true
        name: logstash-1
        image: ""
        user: root
          xpack.monitoring.enabled: "true"
          xpack.monitoring.elasticsearch.username: elc
          xpack.monitoring.elasticsearch.password: XXX
          xpack.monitoring.elasticsearch.ssl.certificate_authority: /usr/share/logstash/config/certificates/ca/ca.crt
          ES_JAVA_OPTS: -Xms8g -Xmx8g
          config.test_and_exit: "false"
          config.reload.automatic: "false"
          config.reload.interval: 60s

          - "/etc/ssl/certs/.logstash_certs:/usr/share/logstash/config/certificates"
          - "/logstashdata/conf.d:/usr/share/logstash/pipeline"
          - "/logstashdata/pipelines.yml:/usr/share/logstash/config/pipelines.yml"
          - nofile:65535:65535
          - memlock:-1:-1
        network_mode: host
        state: started

I have never used docker so I cannot provide help.

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