# Filebeat fails to start for multiple prospectors(Exiting: error loading config file: yaml: line 16: did not find expected key)

**URL:** <https://discuss.elastic.co/t/filebeat-fails-to-start-for-multiple-prospectors-exiting-error-loading-config-file-yaml-line-16-did-not-find-expected-key/76652>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 27, 2017, 4:15pm UTC](https://discuss.elastic.co/t/filebeat-fails-to-start-for-multiple-prospectors-exiting-error-loading-config-file-yaml-line-16-did-not-find-expected-key/76652 "2017-02-27T16:15:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshavardan25000](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@harshavardan25000](https://discuss.elastic.co/u/harshavardan25000)\
**Post date:** [February 27, 2017, 4:15pm UTC](https://discuss.elastic.co/t/filebeat-fails-to-start-for-multiple-prospectors-exiting-error-loading-config-file-yaml-line-16-did-not-find-expected-key/76652/1 "2017-02-27T16:15:55Z")

</div>

I configured filebeat to pull two types of log files and my config looks something like this.

```
filebeat:
  prospectors:
  - input_type: log
    paths:
        - C:\softwares\syslog
      fields: {log_type: syslog}
   - input_type: log 
      paths:
        - C:\softwares\cdr_test.log
      fields: {log_type: cdr}

```

However I am getting error saying did not find the key. I am not able to find the point of error.  
Any inputs are appreciated. Thank you in advance for the assistance.

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [February 27, 2017, 11:44pm UTC](https://discuss.elastic.co/t/filebeat-fails-to-start-for-multiple-prospectors-exiting-error-loading-config-file-yaml-line-16-did-not-find-expected-key/76652/2 "2017-02-27T23:44:18Z")

</div>

Please use the `</>` button to format config files and logs.

YAML is sensitive to indentation. That is, do use spaces and no tabs and try to indent with exactly 2 spaces per level. The formatting in your sample config looks completely off.

corrected (filebeat 5.x required)

```auto
filebeat.prospectors:
- input_type: log
  paths:
    - 'C:\softwares\syslog'
  fields.log_type: syslog
- input_type: log 
  paths:
    - 'C:\softwares\cdr_test.log'
  fields.log_type: cdr

```

interestingly you don't have 16 lines in your sample, so the parsing might finally (well, it's already off) break somewhat later in your config file.

---

<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:** [February 27, 2017, 11:45pm UTC](https://discuss.elastic.co/t/filebeat-fails-to-start-for-multiple-prospectors-exiting-error-loading-config-file-yaml-line-16-did-not-find-expected-key/76652/3 "2017-02-27T23:45:54Z")

</div>

This looks like an indentation problem with your YAML config. Try your config on [http://www.yamllint.com/](http://www.yamllint.com/) and you will see that it's not valid YAML.

(edit: I removed my corrected config since steffens and I both replied at the same time.)

---

<div class="post-metadata">

**Author:** ![harshavardan25000](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@harshavardan25000](https://discuss.elastic.co/u/harshavardan25000)\
**Post date:** [February 28, 2017, 4:11pm UTC](https://discuss.elastic.co/t/filebeat-fails-to-start-for-multiple-prospectors-exiting-error-loading-config-file-yaml-line-16-did-not-find-expected-key/76652/4 "2017-02-28T16:11:37Z")

</div>

Thanks a lot for the assistance @ both. Yes it was indentation problem. Working fine now.

---

<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:** [March 28, 2017, 4:11pm UTC](https://discuss.elastic.co/t/filebeat-fails-to-start-for-multiple-prospectors-exiting-error-loading-config-file-yaml-line-16-did-not-find-expected-key/76652/5 "2017-03-28T16:11:39Z")

</div>

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