Filebeat configtest not working as expected

I have installed Filebeat 5.1 as rpm package on Linux.
I added my own sample config yml (at my home dir, not default location) and tested with filebeat which works as expected.

Now I make small typo (purposely) in sample config just to make sure configtest fails, using following command :
sudo /usr/share/filebeat/bin/filebeat -c /home/myuse/fileBeatTest/filebeat_sample.yml -path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /var/lib/filebeat -path.logs /var/log/filebeat -configtest -e

It still pass with incorrect config !!
If I start Filebeat with this incorrect config, filebeat shows error though.

Can anybody explain how to make sure configtest works correctly ?

What was the typo?

For testing purpose, I changed "filebeat.prospectors" to "1filebeat.prospectors"
Configtest passes , but Filebeat fails to start

With 1filebeat.prospectors it should complain about "No prospectors defined."

What does this output?

/usr/share/filebeat/bin/filebeat -c /home/myuse/fileBeatTest/filebeat_sample.yml -e -d "*" -configtest

And can you paste the contents of /home/myuse/fileBeatTest/filebeat_sample.yml?

/usr/share/filebeat/bin/filebeat -c /home/myuse/fileBeatTest/filebeat_sample.yml -e -d "*" -configtest
works without error (which is wrong obviously)

Here is filebeat config
Please ignore spacing errors , my YML config has correct spacing

1filebeat.prospectors:
- input_type: log
  paths:
    - "/home/pc2856/fileBeatTest/logsDir/manual_logs.log"

output.kafka:
  hosts: ["broker:port"]
  topic: 'my-topic-name'
  partition.round_robin:
    reachable_only: false
  required_acks: 1
  compression: gzip
  max_message_bytes: 1000000

If I correct prospector, filebeat runs fine

Seems like a bug in 5.x. I was able to reproduce with 5.1.1 and the upcoming 5.2.0 RC. You can open a bug report for this.

Testing from the master branch works (snapshots are here):

$ ./filebeat -c .test/filebeat.yml -configtest
Exiting: No prospectors defined. What files do you want me to watch?
1 Like

Thanks for quick replies !
It was very helpful.

I think I will have to use older versions of Filebeat.

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