# Filebeat config/TestReadConfig2

**URL:** <https://discuss.elastic.co/t/filebeat-config-testreadconfig2/58293>\
**Category:** Beats\
**Created:** [August 17, 2016, 9:03pm UTC](https://discuss.elastic.co/t/filebeat-config-testreadconfig2/58293 "2016-08-17T21:03:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![csdrane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/csdrane/32/11436_2.png) [@csdrane](https://discuss.elastic.co/u/csdrane)\
**Post date:** [August 17, 2016, 9:03pm UTC](https://discuss.elastic.co/t/filebeat-config-testreadconfig2/58293/1 "2016-08-17T21:03:39Z")

</div>

I'm new to the beats codebase and am wondering whether test TestReadConfig2 in filebeat/config is working as intended. Namely, it seems that cfgfile.Read() on line 23 isn't working correctly. A println reveals that `config` is unpacked to "zero" values, with an empty Prospectors list. Similarly, if I make a small edit to the yml file and set spool size to 1 the test will still pass (and vice versa). It seems that the way to fix this is to change line 20 `config := &Config{}` to `config := &struct{ Filebeat Config}{}`. It's not super clear to me why exactly this wrapper is necessary -- would appreciate if someone could explain the reason for this and the relevant part of the unpacking code. Let me know if I should add this to the github issue tracker.

This is based on commit `f3f55c4ef8d99ad620f0882f8b55c0caf1d40795` in the master branch.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [August 22, 2016, 10:23am UTC](https://discuss.elastic.co/t/filebeat-config-testreadconfig2/58293/2 "2016-08-22T10:23:57Z")

</div>

I commented on the issue here: [https://github.com/elastic/beats/issues/2309](https://github.com/elastic/beats/issues/2309)

---

<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 7, 2016, 9:03pm UTC](https://discuss.elastic.co/t/filebeat-config-testreadconfig2/58293/3 "2016-09-07T21:03:44Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
