# Multiple Http\_poller inputs with basic authentication

**URL:** <https://discuss.elastic.co/t/multiple-http-poller-inputs-with-basic-authentication/234542>\
**Category:** Logstash\
**Created:** [May 27, 2020, 1:08pm UTC](https://discuss.elastic.co/t/multiple-http-poller-inputs-with-basic-authentication/234542 "2020-05-27T13:08:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferdinandb](https://avatars.discourse-cdn.com/v4/letter/f/439d5e/32.png) [@ferdinandb](https://discuss.elastic.co/u/ferdinandb)\
**Post date:** [May 27, 2020, 1:08pm UTC](https://discuss.elastic.co/t/multiple-http-poller-inputs-with-basic-authentication/234542/1 "2020-05-27T13:08:42Z")

</div>

Hi, I am trying to pull API data from several endpoints all using the same Username and Password. Example:

```auto
input {
 http_poller {
	schedule => { every => "20s" }
	request_timeout => 60
    urls => {
      "Path1" => {
	  method => get
	  user => "user@e.mail"
	  password => "password"
	  url => "https://server.com/api/v2/path/11167/data"
	  headers => {
		Accept => "application/json"
		}
	}  
	  "Path2" => {
	  method => get
	  user => "user@e.mail"
	  password => "password"
	  url => "https://server.com/api/v2/path/11168/data"
	 headers => {
		Accept => "application/json"
		}
	} 
	  "Path3" => {
	  method => get
	  user => "user@e.mail"
	  password => "password"
	  url => "https://server.com/api/v2/path/11169/data"
	 headers => {
		Accept => "application/json"
		}
	} 
    }
    # Decode the results as JSON
    codec => "json"
    # Store metadata about the request in this key
    metadata_target => "http_poller_metadata"
  }
}

output {  
stdout {codec => rubydebug}
}

```

You can see the username/password combination is the same for all, and the URLs are almos tthe same except for the /{number}/data at the end.

So, I have 2 questions:

1. can I put all of the paths into an array (ie [11167,11168,11169]) or
2. can I put the user/password information somewhere else so I only need to store it once

(or 3) can I do both of these things?

---

<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:** [June 24, 2020, 1:08pm UTC](https://discuss.elastic.co/t/multiple-http-poller-inputs-with-basic-authentication/234542/2 "2020-06-24T13:08:51Z")

</div>

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