# HTTP Filter --- Body Syntax

**URL:** <https://discuss.elastic.co/t/http-filter-body-syntax/301217>\
**Category:** Logstash\
**Created:** [March 31, 2022, 2:59pm UTC](https://discuss.elastic.co/t/http-filter-body-syntax/301217 "2022-03-31T14:59:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeremyP](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@JeremyP](https://discuss.elastic.co/u/JeremyP)\
**Post date:** [March 31, 2022, 2:59pm UTC](https://discuss.elastic.co/t/http-filter-body-syntax/301217/1 "2022-03-31T14:59:21Z")

</div>

Hello,

I'm trying to use an HTTP filter with a POST and body and I'm having a hard time nailing down the syntax.

The JSON body which I can get working using postman is as follows:

```auto
{
  "filters": [
      {
        "days": "30",
        "domain": ".google.ca",
        "type": "domain-contains"
      }
  ]
}

```

My logstash config is currently...

```auto
filter {
  http {
    url => "https://192.168.1.1:3780/api/3/sonar_queries/search"
    verb => "POST"
    body => { "filters": [{ "days": "30", "domain": "%{[domain]}", "type": "domain-contains" } ] }
    body_format => "json"
    user => "logstash"
    password => "testing"
    cacert => "/etc/logstash/internetconsole.pem"
    id => "sonar"
    target_body => "[sonar]"
  }
}

```

I'm receiving the following error:

```auto
:exception=>"LogStash::ConfigurationError", :message=>"Expected one of [\\t\\r\\n], \"#\", \"=>\" at line 16, column 24 (byte 302) after filter

```

Any help would be appreciated! Thank you.

---

<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:** [April 28, 2022, 2:59pm UTC](https://discuss.elastic.co/t/http-filter-body-syntax/301217/2 "2022-04-28T14:59:58Z")

</div>

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