# Using filters with logstash-forwarder

**URL:** <https://discuss.elastic.co/t/using-filters-with-logstash-forwarder/1262>\
**Category:** Logstash\
**Created:** [May 25, 2015, 6:38pm UTC](https://discuss.elastic.co/t/using-filters-with-logstash-forwarder/1262 "2015-05-25T18:38:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![palmerabollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/palmerabollo/32/44772_2.png) [@palmerabollo](https://discuss.elastic.co/u/palmerabollo)\
**Post date:** [May 25, 2015, 6:38pm UTC](https://discuss.elastic.co/t/using-filters-with-logstash-forwarder/1262/1 "2015-05-25T18:38:14Z")

</div>

I can use filters such as "environment" to add an environment variable to my logs with the logstash agent. This is very useful when you need to enrich your logs with metadata, for example:

```
filter {
  environment {
    add_field_from_env => {
      "myvar" => "MY_ENV_VAR"
    }
  }
}

```

Is it possible to do the same with logstash-forwarder or are you restricted to a network and a files+fields section as shown in the [example on github](https://github.com/elastic/logstash-forwarder#configuring)?

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 26, 2015, 4:37am UTC](https://discuss.elastic.co/t/using-filters-with-logstash-forwarder/1262/2 "2015-05-26T04:37:35Z")

</div>

LSF doesn't have this, it's a barebones shipper designed for simply shipping.

[This](https://github.com/driskell/log-courier) might do what you want.

---

<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 6, 2017, 5:39am UTC](https://discuss.elastic.co/t/using-filters-with-logstash-forwarder/1262/3 "2017-07-06T05:39:22Z")

</div>


