# How to import data from 2 urls and with different index using http\_roller in logstash conf file

**URL:** <https://discuss.elastic.co/t/how-to-import-data-from-2-urls-and-with-different-index-using-http-roller-in-logstash-conf-file/274051>\
**Category:** Logstash\
**Created:** [May 26, 2021, 11:57am UTC](https://discuss.elastic.co/t/how-to-import-data-from-2-urls-and-with-different-index-using-http-roller-in-logstash-conf-file/274051 "2021-05-26T11:57:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tayfun\_UNAL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tayfun_unal/32/89275_2.png) [@Tayfun\_UNAL](https://discuss.elastic.co/u/Tayfun_UNAL)\
**Post date:** [May 26, 2021, 11:57am UTC](https://discuss.elastic.co/t/how-to-import-data-from-2-urls-and-with-different-index-using-http-roller-in-logstash-conf-file/274051/1 "2021-05-26T11:57:45Z")

</div>

```auto
input {
	http_poller {
		urls => {
 			"1" => {
				type => "article"
				method => GET
 				url => "https://personel.klu.edu.tr/elasticsearch/datasets/makale_bilgisi.json"
 				headers => {
 					Accept => "application/json"
 				}
			}
			"2" => {
				type => "askd"
				method => GET
 				url => "https://personel.klu.edu.tr/elasticsearch/datasets/askd_bilgisi.json"
 				headers => {
 					Accept => "application/json"
 				}
			}
 		}
		codec => "json_lines"
		request_timeout => 60
		schedule => { "in" => "0" }
		metadata_target => "http_poller_metadata"
	}
}
filter {
	json{
		source => "message"
	}
	mutate {
		remove_field => ["@version","@timestamp","path","host", "tags","response_headers","http_poller_metadata","version", "message"]
	} 
}
output {
	stdout {codec => rubydebug}
	if [urls] == ["1"]
	{
    		elasticsearch {
			hosts => ["http://localhost:9200"]
			user => "elastic"
    			password => "123456"
			index => "article"
		}
	}else if [urls] ==["2"]
	{
    		elasticsearch {
			hosts => ["http://localhost:9200"]
			user => "elastic"
    			password => "123456"
			index => "askd"
		}	
	}
}

```

---

<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 23, 2021, 11:57am UTC](https://discuss.elastic.co/t/how-to-import-data-from-2-urls-and-with-different-index-using-http-roller-in-logstash-conf-file/274051/2 "2021-06-23T11:57:46Z")

</div>

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