# Filebeat configtest not working as expected

**URL:** <https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 26, 2017, 9:37pm UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955 "2017-01-26T21:37:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pc2856](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pc2856](https://discuss.elastic.co/u/pc2856)\
**Post date:** [January 26, 2017, 9:37pm UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955/1 "2017-01-26T21:37:32Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [January 26, 2017, 9:54pm UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955/2 "2017-01-26T21:54:17Z")

</div>

What was the typo?

---

<div class="post-metadata">

**Author:** ![pc2856](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pc2856](https://discuss.elastic.co/u/pc2856)\
**Post date:** [January 26, 2017, 11:31pm UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955/3 "2017-01-26T23:31:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [January 26, 2017, 11:44pm UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955/4 "2017-01-26T23:44:41Z")

</div>

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`?

---

<div class="post-metadata">

**Author:** ![pc2856](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pc2856](https://discuss.elastic.co/u/pc2856)\
**Post date:** [January 27, 2017, 12:02am UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955/5 "2017-01-27T00:02:09Z")

</div>

/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

```auto
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

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [January 27, 2017, 12:13am UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955/6 "2017-01-27T00:13:29Z")

</div>

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](https://beats-nightlies.s3.amazonaws.com/index.html?prefix=filebeat/)):

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

```

---

<div class="post-metadata">

**Author:** ![pc2856](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pc2856](https://discuss.elastic.co/u/pc2856)\
**Post date:** [January 27, 2017, 12:29am UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955/7 "2017-01-27T00:29:07Z")

</div>

Thanks for quick replies !  
It was very helpful.

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

---

<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:** [February 24, 2017, 12:29am UTC](https://discuss.elastic.co/t/filebeat-configtest-not-working-as-expected/72955/8 "2017-02-24T00:29:42Z")

</div>

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