# How can i restrict only http post api requests to logstash

**URL:** <https://discuss.elastic.co/t/how-can-i-restrict-only-http-post-api-requests-to-logstash/353685>\
**Category:** Logstash\
**Created:** [February 20, 2024, 11:58am UTC](https://discuss.elastic.co/t/how-can-i-restrict-only-http-post-api-requests-to-logstash/353685 "2024-02-20T11:58:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kashyap\_kapadia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kashyap_kapadia/32/131924_2.png) [@kashyap\_kapadia](https://discuss.elastic.co/u/kashyap_kapadia)\
**Post date:** [February 20, 2024, 11:58am UTC](https://discuss.elastic.co/t/how-can-i-restrict-only-http-post-api-requests-to-logstash/353685/1 "2024-02-20T11:58:01Z")

</div>

Hi All,

i want to restrict only https POST call to be accepted by logstash

for which i did multiple options in http input section as shown below:

```auto
input {
  http {
    port => 5400
        ssl_enabled => true
        ssl_certificate_authorities => ["/etc/gd_#######.crt"]
        ssl_certificate => "/etc/non-p##-#######.crt"
        ssl_key => "/etc/non-p###-#########.key"
        ssl_client_authentication => "required"
        method => "POST"
}
}

```

but i am getting following error

[ERROR][logstash.inputs.http] Unknown setting 'method' for http  
[2024-02-20T11:53:51,047][ERROR][logstash.agent] Failed to execute action {

any help or pointers would be appreciated  
Thanks

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 20, 2024, 12:14pm UTC](https://discuss.elastic.co/t/how-can-i-restrict-only-http-post-api-requests-to-logstash/353685/2 "2024-02-20T12:14:50Z")

</div>

> [@kashyap\_kapadia](#):
>
> [ERROR][logstash.inputs.http] Unknown setting 'method' for http  
> [2024-02-20T11:53:51,047][ERROR][logstash.agent] Failed to execute action {

You are getting this error because there is no such `method` option for the http input.

What you want to do is not possible, you will need to have something like a proxy in front of logstash to limit it if you want.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [February 20, 2024, 2:03pm UTC](https://discuss.elastic.co/t/how-can-i-restrict-only-http-post-api-requests-to-logstash/353685/3 "2024-02-20T14:03:11Z")

</div>

Or drop everything which is not method POST:

```auto
filter{
# with ECS schema
 if [http][method] != "POST" {
 drop {}
 }
}

```

---

<div class="post-metadata">

**Author:** ![kashyap\_kapadia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kashyap_kapadia/32/131924_2.png) [@kashyap\_kapadia](https://discuss.elastic.co/u/kashyap_kapadia)\
**Post date:** [February 20, 2024, 3:28pm UTC](https://discuss.elastic.co/t/how-can-i-restrict-only-http-post-api-requests-to-logstash/353685/4 "2024-02-20T15:28:14Z")

</div>

Thanks ,

this will drop the request silently but will not inform anything to client

---

<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 19, 2024, 3:28pm UTC](https://discuss.elastic.co/t/how-can-i-restrict-only-http-post-api-requests-to-logstash/353685/5 "2024-03-19T15:28:30Z")

</div>

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