# Logstash http poller

**URL:** https://discuss.elastic.co/t/logstash-http-poller/295441
**Category:** Logstash
**Created:** [January 26, 2022, 9:55am UTC](https://discuss.elastic.co/t/logstash-http-poller/295441 "2022-01-26T09:55:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ingram\_Gultom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ingram_gultom/32/56569_2.png) [@Ingram\_Gultom](https://discuss.elastic.co/u/Ingram_Gultom)
#### Post date: [January 26, 2022, 9:55am UTC](https://discuss.elastic.co/t/logstash-http-poller/295441/1 "2022-01-26T09:55:55Z")

</div>

Hi,

I am using logstash 7.13.4 and I want to use http poller for this url

```auto
http://10.10.10.10:8080/dbonequerydata/?username=user/password=password/encrypted=false/conversion=true/DT=csv -H "Content-Type: application/xml" -H "Accept: text/csv" -d @/etc/filebeat/test.xml 

```

and my configuration looks like this

```auto
input {
  http_poller {
    urls => {
      netscout => {
        url => 'http://10.10.10.10:8080/dbonequerydata/?username=user/password=password/encrypted=false/conversion=true/DT=csv -d @/etc/filebeat/test.xml '
        headers => {
          "Content-Type" => "application/xml"
          Accept => "text/csv"
        }
      }
    }
    schedule => { cron => "40 * * * * UTC"}
  }
}

```

when I start the logstash it comes with error **INVALID URL**

I think its because the url paramater in logstash doesn't support this part \*\* -d @/etc/filebeat/test.xml \*\*. But I don't know how to put it elsewhere in logstash input.

Any idea about this?

Thank you

---

<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: [January 26, 2022, 4:35pm UTC](https://discuss.elastic.co/t/logstash-http-poller/295441/2 "2022-01-26T16:35:07Z")

</div>

If you want to send a body with the request you can use

```
urls => {
  netscout => {
    url => 'http://10.10.10.10:8080/dbonequerydata/?username=user/password=password/encrypted=false/conversion=true/DT=csv'
    body => ' ... '
    headers => {

```

You cannot use a reference to a file, you have to put the body in the logstash configuration.

Also, if you are sending a body with the request you should likely be using `method => "post"`.

---

<div class="post-metadata">

### Author: ![Ingram\_Gultom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ingram_gultom/32/56569_2.png) [@Ingram\_Gultom](https://discuss.elastic.co/u/Ingram_Gultom)
#### Post date: [January 26, 2022, 5:58pm UTC](https://discuss.elastic.co/t/logstash-http-poller/295441/3 "2022-01-26T17:58:36Z")

</div>

Hi,

I already update my configuration using body and method post and it solved error **INVALID URL**

```auto
input {
  http_poller {
    urls => {
      netscout => {
        method => post
        url => 'http://10.10.10.10:8080/dbonequerydata/?username=readonly/password=P@ssw0rd/encrypted=false/conversion=true/DT=csv'
        headers => {
          "Content-Type" => "application/xml"
          Accept => "text/csv"
        }
        body => '-d @/etc/filebeat/test.xml'
      }
    }
    schedule => { cron => "* * * * * UTC"}
  }
}

```

But it looks like the schedule is not running at all. From logstash logs no error reported.

```auto
[2022-01-27T00:47:22,994][INFO][logstash.javapipeline][main] Pipeline Java execution initialization time {"seconds"=>0.6}
[2022-01-27T00:47:23,014][INFO][logstash.inputs.http_poller][main] Registering http_poller Input {:type=>nil, :schedule=>{"cron"=>"* * * * * UTC"}, :timeout=>nil}
[2022-01-27T00:47:23,037][INFO][logstash.javapipeline][main] Pipeline started {"pipeline.id"=>"main"}
[2022-01-27T00:47:23,095][INFO][logstash.agent] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
/home/DEV-EXTERNAL/itg/logstash-7.13.4/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/cronline.rb:77: warning: constant ::Fixnum is deprecated

```

---

<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: [January 26, 2022, 6:03pm UTC](https://discuss.elastic.co/t/logstash-http-poller/295441/4 "2022-01-26T18:03:04Z")

</div>

Enable log.level debug and the [input](https://github.com/logstash-plugins/logstash-input-http_poller/blob/cc8dc526f928a3d9a1f7e992ca0674fe50cafc1f/lib/logstash/inputs/http_poller.rb#L188) will log a message every time it issues a request.

Also `body => '-d @/etc/filebeat/test.xml'` will send that literal text with the request, not the contents of the file.

---

<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: [February 23, 2022, 6:03pm UTC](https://discuss.elastic.co/t/logstash-http-poller/295441/5 "2022-02-23T18:03:25Z")

</div>

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