Hello! First of all, I hope this is the right place to ask for help.
I have been trying to use filebeat
to forward application logs generated by an API application to a logstash
instance, which then applies the necessary transformations to forward the data to Elasticsearch.
The problem I am facing is that filebeat
does not seem to be picking up the log files that it is pointed to.
Setup
On this machine, I am running Windows 11 Pro. I have tried to run filebeat
both within a WSL instance (Fedora 42 WSL) and natively, on Windows, using the x86_64 zip. In both environments, I have tried to run the program both as a regular user and as an elevated one (root / Administrator), starting with a fresh setup each time. On top of that, in order to avoid permissions issues, the logs
folder that I am trying to read is present both on the native NTFS filesystem, and within the WSL filesystem, and I have only tried to use the correct one for each instance of Filebeat running.
Symptom
Filebeat does not seem to be logging the files.
Latest log files in ./logs/
do not indicate the harvester has picked up any files:
// ...
"filebeat":{"harvester":{"open_files":0,"running":0}}
// ...
Also, all the files in ./registry/filebeat/*
do not have any signs of the log files from the API. The only files that show up there are some Linux log files, in the WSL instance, when I add /var/log/*.log
to the paths
list in the filestream
input,
Configuration
I am using the following filebeat.yml
:
filebeat.inputs:
- type: filestream
id: test-filestream-id
enabled: true
paths:
- C:\Users\luca\RiderProjects\MinimalAPITest\MinimalAPITest\logs\*.log
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
output.logstash:
enabled: true
hosts: ["logstash-instance-hostname:5044"]
Noting that, when running via WSL, the Windows path is replaced by a path to the same directory copied within the Linux filesystem:
/home/luca/RiderProjects/MinimalAPITest/MinimalAPITest/logs/*.log
The logs
directory only contains one testapi.log
file, generated from a dotnet application.
Of course, I am not able to find the data on the Elastic instance. I strongly suspect that is because there is something wrong with my configuration, so, no data is sent out.
./filebeat test config
and ./filebeat test output
both return a successful output.
Thank you in advance, any help is really appreciated