How to get data


(dinesh) #1

" input {
http_poller {
urls => {
http_poller {
url => " "


(Mark Walkom) #2

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


(dinesh) #3

" input {
http_poller {
urls => {
http_poller {
url => " "


(Mark Walkom) #4

You may want to look at the docs - 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


(dinesh) #5

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.


(dinesh) #6

" input {
http_poller {
urls => {
http_poller {
url => " "


(Christian Dahlqvist) #7

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 which is designed to periodically poll HTTP endpoints.


(dinesh) #8

jasdasdasdasdasda


(Christian Dahlqvist) #9

Have you looked at the examples in the documentation for the http poller input plugin? You need to provide the supported configuration parameters 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}
}

(dinesh) #10

sdasdasdasdasa


(Christian Dahlqvist) #11

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.


(dinesh) #12

@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.


(Christian Dahlqvist) #13

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


(dinesh) #14

" input {
http_poller {
urls => {
http_poller {
url => " "


(Christian Dahlqvist) #15

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?


(dinesh) #16

" input {
http_poller {
urls => {
http_poller {
url => " "**


(Christian Dahlqvist) #17

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
  }
}

(dinesh) #18

" input {
http_poller {
urls => {
http_poller {
url => " "


(Christian Dahlqvist) #19

This part is not the same.


(dinesh) #20

" input {
http_poller {
urls => {
http_poller {
url => " "