# Http filter in Logstash

**URL:** <https://discuss.elastic.co/t/http-filter-in-logstash/325146>\
**Category:** Logstash\
**Created:** [February 9, 2023, 1:16pm UTC](https://discuss.elastic.co/t/http-filter-in-logstash/325146 "2023-02-09T13:16:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manikanta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manikanta/32/113426_2.png) [@manikanta](https://discuss.elastic.co/u/manikanta)\
**Post date:** [February 9, 2023, 1:16pm UTC](https://discuss.elastic.co/t/http-filter-in-logstash/325146/1 "2023-02-09T13:16:39Z")

</div>

hey  
I want to know how to pass a filters output as request body to http filter  
I am trying to pass output of mutate filter as body to http filter.

```auto
mutate {
        remove_field => ["@timestamp", "@version"]
    }
  http {
      body => {}
      url => "${LIGHTSABER_API_ENDPOINT}"
      verb => "POST"
      body_format => "json"
      automatic_retries => 3
      target_body => "response"
  }

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 9, 2023, 4:34pm UTC](https://discuss.elastic.co/t/http-filter-in-logstash/325146/2 "2023-02-09T16:34:05Z")

</div>

> [@manikanta](#):
>
> I want to know how to pass a filters output as response body to http filter

The response body is set by the API you are calling. The request body is set using the body option to the filter, which can include sprintf references.

---

<div class="post-metadata">

**Author:** ![manikanta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manikanta/32/113426_2.png) [@manikanta](https://discuss.elastic.co/u/manikanta)\
**Post date:** [February 9, 2023, 8:28pm UTC](https://discuss.elastic.co/t/http-filter-in-logstash/325146/3 "2023-02-09T20:28:42Z")

</div>

Thank you.  
That's a typo. I found the answer here. [How to set HTTP filter body to whole event](https://discuss.elastic.co/t/how-to-set-http-filter-body-to-whole-event/243041)

---

<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:** [March 9, 2023, 8:29pm UTC](https://discuss.elastic.co/t/http-filter-in-logstash/325146/4 "2023-03-09T20:29:20Z")

</div>

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