# Filebeat Module's Yaml Config Issue

**URL:** https://discuss.elastic.co/t/filebeat-modules-yaml-config-issue/287231
**Category:** Beats
**Tags:** beats-module, filebeat
**Created:** [October 20, 2021, 7:21pm UTC](https://discuss.elastic.co/t/filebeat-modules-yaml-config-issue/287231 "2021-10-20T19:21:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Cassie\_Danaher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cassie_danaher/32/76682_2.png) [@Cassie\_Danaher](https://discuss.elastic.co/u/Cassie_Danaher)
#### Post date: [October 20, 2021, 7:21pm UTC](https://discuss.elastic.co/t/filebeat-modules-yaml-config-issue/287231/1 "2021-10-20T19:21:36Z")

</div>

I was under the impression that I could use filebeats keystore, to hold security information and then call those variables in the config file. When I try to do that it throws an error "mapping values are not allowed in this context".

Is there a way I can do this as I don't want to put the API token in the config file?  
Also after trying to do this if I try to change it back to the straight token it still throws the same error.  
Below is the copy/paste of that config file, with the okta domain part changed to the placeholder domain.

```auto
# Module: okta
# Docs: https://www.elastic.co/guide/en/beats/filebeat/7.x/filebeat-module-okta.html

- module: okta
  system:
     enabled: true
      var.url: https://domain.okta.com/api/v1/logs
      var.api_key: "${okta_key}"

```

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [October 20, 2021, 8:34pm UTC](https://discuss.elastic.co/t/filebeat-modules-yaml-config-issue/287231/2 "2021-10-20T20:34:55Z")

</div>

Hi @Cassie_Danaher I fixed your formatting of your post a bit. Please use the `</>` button to format your code in a post.

If that is your exact yml there is improper indentation

Perhaps this...

```auto
- module: okta
  system:
    enabled: true
    var.url: https://domain.okta.com/api/v1/logs
    var.api_key: "${okta_key}"

```

With respect to the keystore yes you should be able to use that and it looks like correct usages assuming you added the that key to the keystore correctly.

---

<div class="post-metadata">

### Author: ![Cassie\_Danaher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cassie_danaher/32/76682_2.png) [@Cassie\_Danaher](https://discuss.elastic.co/u/Cassie_Danaher)
#### Post date: [October 20, 2021, 9:18pm UTC](https://discuss.elastic.co/t/filebeat-modules-yaml-config-issue/287231/3 "2021-10-20T21:18:30Z")

</div>

Thank you Stephen that solved the issue. I'm not sure whether to be frustrated about two spaces or relieved my syntax was right. It is all working beautifully now, thank you.

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [October 20, 2021, 9:58pm UTC](https://discuss.elastic.co/t/filebeat-modules-yaml-config-issue/287231/4 "2021-10-20T21:58:17Z")

</div>

Cool just to be clear that is yaml... not elastic... yaml is super pickey.

You can always test your config see [here](https://www.elastic.co/guide/en/beats/filebeat/current/command-line-options.html#test-command)

---

<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: [November 17, 2021, 11:59pm UTC](https://discuss.elastic.co/t/filebeat-modules-yaml-config-issue/287231/5 "2021-11-17T23:59:03Z")

</div>

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