Hi, I’m running Logstash on SUSE Linux where I’ve installed the RPM package for compatibility. Currently, When I start logstash as a service
sudo systemctl stop logstash.service
and check service status it seems to be running fine
logstash.service - logstash
Loaded: loaded (/etc/systemd/system/logstash.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2023-12-15 00:04:35 UTC; 26s ago
Main PID: 27892 (java)
Tasks: 34
CGroup: /system.slice/logstash.service
└─ 27892 /usr/share/logstash/jdk/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly>
Dec 15 00:04:54 hana-kms-01 logstash[27892]: value.serializer = class org.apache.kafka.common.serialization.StringSerializer
Dec 15 00:04:55 hana-kms-01 logstash[27892]: [2023-12-15T00:04:55,028][INFO ][org.apache.kafka.common.utils.AppInfoParser][main] Kafka version: 2.5.1
Dec 15 00:04:55 hana-kms-01 logstash[27892]: [2023-12-15T00:04:55,032][INFO ][org.apache.kafka.common.utils.AppInfoParser][main] Kafka commitId: 0efa8fb0f4c73d92
Dec 15 00:04:55 hana-kms-01 logstash[27892]: [2023-12-15T00:04:55,032][INFO ][org.apache.kafka.common.utils.AppInfoParser][main] Kafka startTimeMs: 1702598695017
Dec 15 00:04:55 hana-kms-01 logstash[27892]: [2023-12-15T00:04:55,211][INFO ][logstash.javapipeline ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.wor>
Dec 15 00:04:55 hana-kms-01 logstash[27892]: [2023-12-15T00:04:55,640][INFO ][org.apache.kafka.clients.Metadata][main] [Producer clientId=producer-1] Cluster ID: 4tW>
Dec 15 00:04:56 hana-kms-01 logstash[27892]: [2023-12-15T00:04:56,046][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds">
Dec 15 00:04:56 hana-kms-01 logstash[27892]: [2023-12-15T00:04:56,102][INFO ][logstash.javapipeline ][main] Pipeline started {"pipeline.id"=>"main"}
Dec 15 00:04:56 hana-kms-01 logstash[27892]: [2023-12-15T00:04:56,158][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :>
Dec 15 00:04:56 hana-kms-01 logstash[27892]: [2023-12-15T00:04:56,210][INFO ][filewatch.observingtail ][main][ab83158615982f8d6ca1fe433994b8eeb743c067c6e0406b48078d>
lines 1-18/18 (END)
The problem is no logs are been sent to my file output or Kafka. However, if I run from the command line with
/usr/share/logstash/bin/logstash --debug -f /etc/logstash/conf.d/test-logs.conf
on, the logs are read and sent to kafka just fine.
This is the content of /etc/systemd/system/logstash.service
- (I removed "--path.settings" "/etc/logstash"
as suggested in one of the community posts below)
[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
And this is the content for /etc/logstash/pipelines.yml
# This file is where you define your pipelines. You can define multiple.
# For more information on multiple pipelines, see the documentation:
#
https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html
- pipeline.id: main
path.config: "/etc/logstash/conf.d/test-logs.conf"
I’ve checked the permissions which look correct -rw-r--r-- 1 root root 460 Dec 14 22:13 /etc/logstash/conf.d/test-logs.conf
Also I've followed advice in these posts:
I’ve ran out of options of things to try and nothing seems to make it work, I'm new to Logstash, so any help would be appreciated !