# What does this filter do?

**URL:** <https://discuss.elastic.co/t/what-does-this-filter-do/159351>\
**Category:** Logstash\
**Created:** [December 4, 2018, 11:59am UTC](https://discuss.elastic.co/t/what-does-this-filter-do/159351 "2018-12-04T11:59:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![przemolb](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@przemolb](https://discuss.elastic.co/u/przemolb)\
**Post date:** [December 4, 2018, 11:59am UTC](https://discuss.elastic.co/t/what-does-this-filter-do/159351/1 "2018-12-04T11:59:59Z")

</div>

Hello,

can anybody explain me what does the following filter do ?

```auto
filter {
  if [@metadata][input-http] {
    date {
      match => ["date", "UNIX"]
      remove_field => ["date"]
    }
    mutate {
      remove_field => ["headers","host"]
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [December 5, 2018, 3:22am UTC](https://discuss.elastic.co/t/what-does-this-filter-do/159351/2 "2018-12-05T03:22:25Z")

</div>

if the @metadata tag contains "input-http" then:  
Use the "date" field (which is in UNIX Epoch format) and turn it into the @timestamp field (by default)  
Then remove the "date" field (since the info is now in @timestamp)  
Next use the mutate filter and remove the two fields "headers" and "host"  
End.

---

<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:** [January 2, 2019, 3:22am UTC](https://discuss.elastic.co/t/what-does-this-filter-do/159351/3 "2019-01-02T03:22:36Z")

</div>

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