# POST form data with Logstash http\_poller input plug-in

**URL:** <https://discuss.elastic.co/t/post-form-data-with-logstash-http-poller-input-plug-in/102362>\
**Category:** Logstash\
**Created:** [October 1, 2017, 2:17am UTC](https://discuss.elastic.co/t/post-form-data-with-logstash-http-poller-input-plug-in/102362 "2017-10-01T02:17:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Invigor](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@Invigor](https://discuss.elastic.co/u/Invigor)\
**Post date:** [October 1, 2017, 2:17am UTC](https://discuss.elastic.co/t/post-form-data-with-logstash-http-poller-input-plug-in/102362/1 "2017-10-01T02:17:19Z")

</div>

Hi,

I'm trying to use the http\_poller input plug-in to recreate the curl statement below.

```
curl --user xps_client: --basic --data "username=admin&password=admin&scope=XPS_API_ALL&grant_type=password" http://xps.invigorinsights.com/oauth/token

```

My input configuration is as follows:

```
input {
  http_poller {
    urls => {
      test => {
        # Supports all options supported by ruby's Manticore HTTP client
        method => post
        url => "http://xps.invigorinsights.com/oauth/token"
        user => "xps_client"
        password => ""
        headers => {
            content-type => "application/x-www-form-urlencoded"
        }
        body => "username=admin&password=password&scope=XPS_API_ALL&grant_type=password"
      }
    }
    request_timeout => 60
    # Supports "cron", "every", "at" and "in" schedules by rufus scheduler
    schedule => { every => "1d"}
    codec => "json"
    # A hash of request metadata info (timing, response headers, etc.) will be sent here
    metadata_target => "http_poller_metadata"
  }
}

```

I'm getting an error back from the request which suggests the body is not correctly formatted.

Can anyone see what I'm doing wrong?

Thanks,

Michael

---

<div class="post-metadata">

**Author:** ![Invigor](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@Invigor](https://discuss.elastic.co/u/Invigor)\
**Post date:** [October 1, 2017, 3:03am UTC](https://discuss.elastic.co/t/post-form-data-with-logstash-http-poller-input-plug-in/102362/2 "2017-10-01T03:03:43Z")

</div>

Ended up finding a work around as the user and password parameters don't seem to work for Basic authorization.

I used TCPDUMP to see what Logstash is actually calling and there is no Authorization header being passed.

To get this to work, I copied the Authorization header value (Basic ) value from running TCPDUMP with the original curl command.

Got rid of the user and password parameters in the input filter config and it now works.

---

<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:** [October 29, 2017, 3:03am UTC](https://discuss.elastic.co/t/post-form-data-with-logstash-http-poller-input-plug-in/102362/3 "2017-10-29T03:03:55Z")

</div>

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