Http polar authentication


(Usha Datt) #1

I am using http polar to parse a json API with authentication required at the beginning.
Its showing an error that the URL is incorrect. And when I am checking my config file using --configtest, its showing the conf file is OK.
Where am I going wrong?
Following is my code:

> input 
> {
>                 http_poller {
>                                 urls => {
>                                 test1 => "http://json-url-example"
>                                                 auth => {
>                                                 user => "user"
>                                                 password => "password"
>                                                 }

>                                                 }

>                 interval => 10830
>                 codec => "json"
>                                 }
> }

(Magnus B├Ąck) #2

Its showing an error that the URL is incorrect.

Seeing the exact error message would've been useful.

Your configuration is indeed not correct. It needs to be like this:

http_poller {
  urls => {
    test1 => {
      url => "http://json-url-example"
      auth => {
        user => "user"
        password => "password"
      }
    }
  }
  interval => 10830
  codec => "json"
}

Indenting the configuration properly makes mistakes like this easier to spot.


(Usha Datt) #3

@magnusbaeck Thanks Magnus!


(system) #4