# Problems to start Logstash conf pipelines with SystemCTL

**URL:** <https://discuss.elastic.co/t/problems-to-start-logstash-conf-pipelines-with-systemctl/282811>\
**Category:** Logstash\
**Created:** [August 30, 2021, 12:40pm UTC](https://discuss.elastic.co/t/problems-to-start-logstash-conf-pipelines-with-systemctl/282811 "2021-08-30T12:40:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leandro\_Valim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandro_valim/32/93886_2.png) [@Leandro\_Valim](https://discuss.elastic.co/u/Leandro_Valim)\
**Post date:** [August 30, 2021, 12:40pm UTC](https://discuss.elastic.co/t/problems-to-start-logstash-conf-pipelines-with-systemctl/282811/1 "2021-08-30T12:40:43Z")

</div>

I have a problem with logstash, when I running like this:/usr/share/logstash/bin/logstash --debug -f /etc/logstash/conf.d/switch.conf  
Works fine and start this specific configuration file.

But I put this conf file in pipelines.yml, and when I tried to run my logstash through systemctl start logstash.service , appears status OK, but the configuration switch.conf not starts. Another strange behavior I`m see, that the log files folder /var/log/logstash still empty with no logs.

The config files are bellow:

# cat /etc/logstash/logstash.yml |grep -v ^#

path.data: /var/lib/logstash  
pipeline.ordered: auto

path.logs: /var/log/logstash

* * *

# cat pipelines.yml

# This file is where you define your pipelines. You can define multiple.

# For more information on multiple pipelines, see the documentation:

# [Multiple Pipelines | Logstash](https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html)

- pipeline.id: main  
path.config: "/etc/logstash/conf.d/\*.conf"
- pipeline.id: switch  
path.config: "/etc/logstash/conf.d/switch.conf"

* * *

# cat /etc/systemd/system/logstash.service

[Unit]  
Description=logstash

[Service]  
Type=simple  
User=logstash  
Group=logstash

# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.

# Prefixing the path with '-' makes it try to load, but if the file doesn't

# exist, it continues onward.

EnvironmentFile=-/etc/default/logstash  
EnvironmentFile=-/etc/sysconfig/logstash  
ExecStart=/usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash"  
Restart=always  
WorkingDirectory=/  
Nice=19  
LimitNOFILE=16384

# When stopping, how long to wait before giving up and sending SIGKILL?

# Keep in mind that SIGKILL on a process can cause data loss.

TimeoutStopSec=infinity

[Install]  
WantedBy=multi-user.target

* * *

# cat /etc/default/logstash

LS\_HOME="/usr/share/logstash"  
LS\_SETTINGS\_DIR="/etc/logstash"  
LS\_PIDFILE="/var/run/logstash.pid"  
LS\_USER="logstash"  
LS\_GROUP="logstash"  
LS\_GC\_LOG\_FILE="/var/log/logstash/gc.log"  
LS\_OPEN\_FILES="16384"  
LS\_NICE="19"  
SERVICE\_NAME="logstash"  
SERVICE\_DESCRIPTION="logstash"

* * *

# ls -la /var/log/logstash/

total 8  
drwxr-xr-x 2 logstash root 4096 jul 29 16:45 .  
drwxr-xr-x 11 root root 4096 ago 29 00:00 ..

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 30, 2021, 1:17pm UTC](https://discuss.elastic.co/t/problems-to-start-logstash-conf-pipelines-with-systemctl/282811/2 "2021-08-30T13:17:19Z")

</div>

This is your `pipelines.yml` ?

```auto
- pipeline.id: main
  path.config: "/etc/logstash/conf.d/*.conf"
- pipeline.id: switch
  path.config: "/etc/logstash/conf.d/switch.conf"

```

If so, this is wrong, it will make logstash read the `switch.conf` twice, the `main` pipeline will read all the `.conf` files inside the `conf.d` directory.

If your `switch.conf` pipeline is listening on some port, it will not run when logstash tries to start the `switch` pipeline as it would already be listening when the `main` pipeline was started.

Remove the first two lines and try to use this `pipelines.yml`

```auto
- pipeline.id: switch
  path.config: "/etc/logstash/conf.d/switch.conf"

```

---

<div class="post-metadata">

**Author:** ![Leandro\_Valim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandro_valim/32/93886_2.png) [@Leandro\_Valim](https://discuss.elastic.co/u/Leandro_Valim)\
**Post date:** [August 30, 2021, 1:19pm UTC](https://discuss.elastic.co/t/problems-to-start-logstash-conf-pipelines-with-systemctl/282811/3 "2021-08-30T13:19:03Z")

</div>

Thank you.... works fine!!!!

---

<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:** [September 27, 2021, 1:19pm UTC](https://discuss.elastic.co/t/problems-to-start-logstash-conf-pipelines-with-systemctl/282811/4 "2021-09-27T13:19:15Z")

</div>

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