# Specifying complex objects in environment variable doesn't work with Logstash output

**URL:** <https://discuss.elastic.co/t/specifying-complex-objects-in-environment-variable-doesnt-work-with-logstash-output/142824>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 2, 2018, 11:34pm UTC](https://discuss.elastic.co/t/specifying-complex-objects-in-environment-variable-doesnt-work-with-logstash-output/142824 "2018-08-02T23:34:23Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Alsheh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alsheh/32/36799_2.png) [@Alsheh](https://discuss.elastic.co/u/Alsheh)\
**Post date:** [August 6, 2018, 10:50pm UTC](https://discuss.elastic.co/t/specifying-complex-objects-in-environment-variable-doesnt-work-with-logstash-output/142824/6 "2018-08-06T22:50:55Z")

</div>

Problem solved!

I used `sudo` when I ran filebeat which does not preserve env variables for security purposes. [This post helped](https://discuss.elastic.co/t/env-variables-in-not-working-in-custom-fields-in-filebeat/101374/4?u=alsheh).

---

_[View the full topic](https://discuss.elastic.co/t/specifying-complex-objects-in-environment-variable-doesnt-work-with-logstash-output/142824)._
