# Exiting: error loading config file: yaml: line 48: did not find expected key

**URL:** <https://discuss.elastic.co/t/exiting-error-loading-config-file-yaml-line-48-did-not-find-expected-key/307508>\
**Category:** APM\
**Tags:** server\
**Created:** [June 17, 2022, 12:10pm UTC](https://discuss.elastic.co/t/exiting-error-loading-config-file-yaml-line-48-did-not-find-expected-key/307508 "2022-06-17T12:10:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orkun\_CELIK](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orkun_celik/32/89237_2.png) [@Orkun\_CELIK](https://discuss.elastic.co/u/Orkun_CELIK)\
**Post date:** [June 17, 2022, 12:10pm UTC](https://discuss.elastic.co/t/exiting-error-loading-config-file-yaml-line-48-did-not-find-expected-key/307508/1 "2022-06-17T12:10:34Z")

</div>

Hi All ,

After editing apm.yml in elastic apm, we get the following error.  
We get the error in the index line.

output.Elasticsearch:  
hosts: ["[https://10.0.0.12:9200](https://10.0.0.12:9200)", "[https://10.0.0.13:9200](https://10.0.0.13:9200)", "[https://10.0.0.14:9200](https://10.0.0.14:9200)", "[https://10.0.0.15:9200](https://10.0.0.15:9200)", "[https://10.0.0.16:9200](https://10.0.0.16:9200)"]  
indices:

- index: "apm-%{[observer.version]}-error-%{+yyyy.MM.dd}"  
when.contains:  
processor.event: "error"  
enabled: true  
api\_key: "paVeH4EBgtb9GXBaTD4t:FRDQikP5TkCf6bhf8afePw"  
ssl.enabled: true  
ssl.verification\_mode: certificate  
ssl.certificate\_authorities: ["/etc/apm-server/certs/ca.crt"]  
bulk\_max\_size: 1000

apm-server test output --v DEBUG

Error initializing beat: error loading config file: yaml: line 47: did not find expected key

Can you help on the subject?

Thanks.

---

<div class="post-metadata">

**Author:** ![Orkun\_CELIK](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orkun_celik/32/89237_2.png) [@Orkun\_CELIK](https://discuss.elastic.co/u/Orkun_CELIK)\
**Post date:** [June 17, 2022, 1:03pm UTC](https://discuss.elastic.co/t/exiting-error-loading-config-file-yaml-line-48-did-not-find-expected-key/307508/2 "2022-06-17T13:03:01Z")

</div>

Hi again ,

1 character left snapping has been fixed.

(when.contains and processor.event)

- index: "apm-sourcemap"  
when.contains:  
processor.event: "sourcemap"

- index: "apm-%{[service.name]}-error"  
when.contains:  
processor.event: "error"

- index: "apm-%{[service.name]}-transaction"  
when.contains:  
processor.event: "transaction"

- index: "apm-%{[service.name]}-span"  
when.contains:  
processor.event: "span"

- index: "apm-%{[service.name]}-metric"  
when.contains:  
processor.event: "metric"

Regards.

---

<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:** [July 8, 2022, 9:03am UTC](https://discuss.elastic.co/t/exiting-error-loading-config-file-yaml-line-48-did-not-find-expected-key/307508/3 "2022-07-08T09:03:48Z")

</div>

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