# How to get data

**URL:** <https://discuss.elastic.co/t/how-to-get-data/70260>\
**Category:** Elasticsearch\
**Created:** [December 30, 2016, 9:50am UTC](https://discuss.elastic.co/t/how-to-get-data/70260 "2016-12-30T09:50:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [December 30, 2016, 9:50am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/1 "2016-12-30T09:50:19Z")

</div>

" input {  
http\_poller {  
urls =\> {  
http\_poller {  
url =\> " "

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 1, 2017, 1:23am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/2 "2017-01-01T01:23:27Z")

</div>

That doesn't look like a valid config, your inputs are incomplete.

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 2, 2017, 6:34am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/3 "2017-01-02T06:34:27Z")

</div>

" input {  
http\_poller {  
urls =\> {  
http\_poller {  
url =\> " "

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 2, 2017, 7:05am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/4 "2017-01-02T07:05:39Z")

</div>

You may want to look at the docs - [https://www.elastic.co/guide/en/logstash/5.1/plugins-inputs-http.html](https://www.elastic.co/guide/en/logstash/5.1/plugins-inputs-http.html)

However I think you actually want [https://www.elastic.co/guide/en/logstash/5.1/plugins-inputs-http\_poller.html](https://www.elastic.co/guide/en/logstash/5.1/plugins-inputs-http_poller.html)

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 3, 2017, 6:03am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/5 "2017-01-03T06:03:23Z")

</div>

Hello Warkolm.I have gone through both the docs and made my cfg file accordingly but still indices are created in elastic search .There are some additional fields need to add in input to get data in elastic search.Any tips appreciated to what i need to add in input.

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 10, 2017, 9:56am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/6 "2017-01-10T09:56:02Z")

</div>

" input {  
http\_poller {  
urls =\> {  
http\_poller {  
url =\> " "

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 10, 2017, 10:05am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/7 "2017-01-10T10:05:06Z")

</div>

As @warkolm pointed out earlier, the HTTP input plugin acts as a server and expects requests. It does not poll an HTTP endpoint, which seems what you are trying to do. You should probably look at the [HTTP poller input plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html) which is designed to periodically poll HTTP endpoints.

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 10, 2017, 11:58am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/8 "2017-01-10T11:58:33Z")

</div>

jasdasdasdasdasda

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 10, 2017, 12:27pm UTC](https://discuss.elastic.co/t/how-to-get-data/70260/9 "2017-01-10T12:27:43Z")

</div>

Have you looked at the examples in the documentation for the [http poller input plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html)? You need to provide the [supported configuration parameters](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html#_synopsis_18) and can not create your own. If you look in the documentation, you can see that neither the http nor the http poller input plugin supports parameters named `http_method` or `uri` which you seem to have in your config file.

Start with something simple like this and expand it until it works:

```
input {
  http_poller {
   urls => {
     walmart => "http://api.walmartlabs.com/v1/search?query=ipod&format=json&apiKey="
   }
   interval => 10
 }
}

output {
  stdout { codec => rubydebug}
}
```

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 10, 2017, 12:55pm UTC](https://discuss.elastic.co/t/how-to-get-data/70260/10 "2017-01-10T12:55:28Z")

</div>

sdasdasdasdasa

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 10, 2017, 1:16pm UTC](https://discuss.elastic.co/t/how-to-get-data/70260/11 "2017-01-10T13:16:54Z")

</div>

It is good practice to output to stdout while debugging. Once it is working and the created documents look like you expect you can add the elastic search output.

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 13, 2017, 7:26am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/12 "2017-01-13T07:26:10Z")

</div>

@christian . I tried with same file with my api key with few changes but still it is not working giving an error ""plugin not defined in namespace" as soon as it start executing cfg file and showing as an invalid URL.Not sure what to do in it.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 13, 2017, 7:40am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/13 "2017-01-13T07:40:06Z")

</div>

Which version of Logstash are you using? What were the few changes you made? Can you show the exact error message?

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 13, 2017, 9:10am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/14 "2017-01-13T09:10:09Z")

</div>

" input {  
http\_poller {  
urls =\> {  
http\_poller {  
url =\> " "

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 13, 2017, 9:43am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/15 "2017-01-13T09:43:45Z")

</div>

Please do not paste screenshots of text as it is very hard to read. It seems to be complaining about an incorrect configuration. What does your config file look like?

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 13, 2017, 9:47am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/16 "2017-01-13T09:47:18Z")

</div>

" input {  
http\_poller {  
urls =\> {  
http\_poller {  
url =\> " "\*\*

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 13, 2017, 10:07am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/17 "2017-01-13T10:07:31Z")

</div>

If you look in the documentation you can see that your URL configuration is wrong. It should look like this:

```
input {
  http_poller {
    urls => {
      test2 => {
        method => get
        url => "http://api.walmartlabs.com/v1/search?query=ipod&format=json&apiKey=x"
        headers => {
          Accept => "application/json"
        }
      }
    }
    request_timeout => 60
    schedule => { cron => "* * * * * UTC"}
    codec => "json"
    metadata_target => "http_poller_metadata"
  }
}

output {
  stdout {
    codec => rubydebug
  }
}
```

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 13, 2017, 10:38am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/18 "2017-01-13T10:38:25Z")

</div>

" input {  
http\_poller {  
urls =\> {  
http\_poller {  
url =\> " "

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 13, 2017, 10:47am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/19 "2017-01-13T10:47:06Z")

</div>

> [@dineshangari](#):
>
> urls =\> {"[http://api.walmartlabs.com/v1/search?query=ipod&format=json&apiKey=](http://api.walmartlabs.com/v1/search?query=ipod&format=json&apiKey=) "

This part is not the same.

---

<div class="post-metadata">

**Author:** ![dineshangari](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dineshangari](https://discuss.elastic.co/u/dineshangari)\
**Post date:** [January 13, 2017, 10:49am UTC](https://discuss.elastic.co/t/how-to-get-data/70260/20 "2017-01-13T10:49:01Z")

</div>

" input {  
http\_poller {  
urls =\> {  
http\_poller {  
url =\> " "

[Next page](https://discuss.elastic.co/t/how-to-get-data/70260.md?page=2)
