# Filebeat config using keystore and arrays broke with Kibana 8 update

**URL:** https://discuss.elastic.co/t/filebeat-config-using-keystore-and-arrays-broke-with-kibana-8-update/312680
**Category:** Beats
**Tags:** filebeat
**Created:** [August 23, 2022, 7:33am UTC](https://discuss.elastic.co/t/filebeat-config-using-keystore-and-arrays-broke-with-kibana-8-update/312680 "2022-08-23T07:33:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![archon810](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/archon810/32/67033_2.png) [@archon810](https://discuss.elastic.co/u/archon810)
#### Post date: [August 23, 2022, 7:33am UTC](https://discuss.elastic.co/t/filebeat-config-using-keystore-and-arrays-broke-with-kibana-8-update/312680/1 "2022-08-23T07:33:45Z")

</div>

Hi there,

For years we've successfully used kibana filebeats where the `var.paths` variable was specified using the keystore rather than being hardcoded in the config file, like so:

```auto
vi /etc/filebeat/modules.d/custom_nginx.yml
#NGINX logs module
- module: custom_nginx
  access:
    enabled: true
    var.paths: "${NGINX_ACCESS_PATHS}"
  error:
    enabled: true
    var.paths: "${NGINX_ERROR_PATHS}"

```

The keystore value was specified like so:

```auto
filebeat keystore create
echo [\"/var/log/nginx/*-microcache.log\", \"/var/log/nginx/*-staticlb.log\"] | filebeat keystore add NGINX_ACCESS_PATHS --stdin --force
echo [\"/var/log/nginx/*error.log*\"] | filebeat keystore add NGINX_ERROR_PATHS --stdin --force

```

However, as of ES8, it seems that there's now a config parsing error:

```auto
Exiting: Failed to start crawler: creating module reloader failed: could not create module registry for filesets: error getting config for fileset custom_nginx/access: Error interpreting the template of the input: template: text:3:22: executing "text" at <.paths>: range can't iterate over ["/var/log/nginx/*-microcache.log", "/var/log/nginx/*-staticlb.log"]

```

I'm not sure how to fix this. I tried moving the brackets (which is valid alternate syntax in YAML for arrays) into the config file and out of the keystore value, but without any luck. I also tried removing the quotes around the `${NGINX_XXXXXXX_PATHS}` references to no avail.

Any ideas?

---

<div class="post-metadata">

### Author: ![cmacknz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cmacknz/32/103773_2.png) [@cmacknz](https://discuss.elastic.co/u/cmacknz)
#### Post date: [August 23, 2022, 7:29pm UTC](https://discuss.elastic.co/t/filebeat-config-using-keystore-and-arrays-broke-with-kibana-8-update/312680/2 "2022-08-23T19:29:55Z")

</div>

If you are upgrading to the 8.3 release the problem may be this change: [Upgrade elastic-agent-libs to pick up fix to keystore package by cmacknz · Pull Request #31694 · elastic/beats · GitHub](https://github.com/elastic/beats/pull/31694)

The configuration parser used for values loaded from the keystore used to parse commas and brackets as arrays, which lead to problems when valid passwords or secrets contained those characters. I don't think we anticipated this use of the keystore when we made that change, we were focused on the password/secret use case which is the main use case for the keystore.

The value parsing should still work the way you want with values kept outside of the keystore.

---

<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 20, 2022, 9:30pm UTC](https://discuss.elastic.co/t/filebeat-config-using-keystore-and-arrays-broke-with-kibana-8-update/312680/3 "2022-09-20T21:30:40Z")

</div>

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