# Boolean Env vars

**URL:** https://discuss.elastic.co/t/boolean-env-vars/180995
**Category:** Beats
**Tags:** metricbeat
**Created:** [May 14, 2019, 12:01pm UTC](https://discuss.elastic.co/t/boolean-env-vars/180995 "2019-05-14T12:01:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![yasin](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@yasin](https://discuss.elastic.co/u/yasin)
#### Post date: [May 14, 2019, 12:01pm UTC](https://discuss.elastic.co/t/boolean-env-vars/180995/1 "2019-05-14T12:01:51Z")

</div>

Dear Elastic Team,

Would like the know if it's possible to put a env variable as shown below:

```
- module: mysql
enabled: ${MYSQL_ENABLE}
  metricsets:

```

[https://www.elastic.co/guide/en/beats/heartbeat/current/using-environ-vars.html](https://www.elastic.co/guide/en/beats/heartbeat/current/using-environ-vars.html)

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [May 14, 2019, 9:09pm UTC](https://discuss.elastic.co/t/boolean-env-vars/180995/2 "2019-05-14T21:09:28Z")

</div>

Hi @yasin 🙂

We currently don't support anything like this. Environment variable expansion is used for dynamic values in already defined fields.

The only workaround I can think of now is to have a bash script that runs metricbeat and activates/deactivates a module before running with with `metricbeat enable module [module]`

---

<div class="post-metadata">

### Author: ![yasin](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@yasin](https://discuss.elastic.co/u/yasin)
#### Post date: [May 15, 2019, 5:51am UTC](https://discuss.elastic.co/t/boolean-env-vars/180995/3 "2019-05-15T05:51:21Z")

</div>

Dear Mario,

Thank you for your swift reply. I'm using the reference.yml file in my metricbeat.yml so how will this be reflected when enabling the module or disabling it?  
When enabling, will my configuration in modules.d be enabled or my metricbeat.yml file will be used?

---

<div class="post-metadata">

### Author: ![yasin](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@yasin](https://discuss.elastic.co/u/yasin)
#### Post date: [May 15, 2019, 6:31am UTC](https://discuss.elastic.co/t/boolean-env-vars/180995/4 "2019-05-15T06:31:05Z")

</div>

Dear Carlo,

Maybe a better solution is to leave the ENV variable empty.  
Topic can be closed.

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [May 15, 2019, 1:13pm UTC](https://discuss.elastic.co/t/boolean-env-vars/180995/5 "2019-05-15T13:13:10Z")

</div>

If you use the config file for the module defined in the `modules.d` folder, the config is stored in it with a `.disabled` extension (or not) but you don't loose it.

---

<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: [June 12, 2019, 1:13pm UTC](https://discuss.elastic.co/t/boolean-env-vars/180995/6 "2019-06-12T13:13:13Z")

</div>

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