# How to use Type string in a multiple input Http\_Poller for different Grok pattern

**URL:** <https://discuss.elastic.co/t/how-to-use-type-string-in-a-multiple-input-http-poller-for-different-grok-pattern/210759>\
**Category:** Logstash\
**Created:** [December 5, 2019, 6:08pm UTC](https://discuss.elastic.co/t/how-to-use-type-string-in-a-multiple-input-http-poller-for-different-grok-pattern/210759 "2019-12-05T18:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamalesh](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kamalesh](https://discuss.elastic.co/u/kamalesh)\
**Post date:** [December 5, 2019, 6:08pm UTC](https://discuss.elastic.co/t/how-to-use-type-string-in-a-multiple-input-http-poller-for-different-grok-pattern/210759/1 "2019-12-05T18:08:48Z")

</div>

Hi All,

I am trying to using multiple Url's for the http\_poller and need to use a different Grok patterns for each of the Url's  
I am aware that i can make use of type string in the Input plugins and make Grok patterns using 'If' condition , if it matches the type.  
I tried to built with the below sample file ,Provide me help on building it .

```
input {
http_poller {
urls => {
url1 => "https://hedeededededje"
type[url1] => "JVM_Memory"
}
}
http_poller {
urls => {
url2 => "https://wwdwjjwhewkjek"
type[url2] => "GC"
}
}
request_timeout => 60
user => "tttttt"
password => "yyyyyy"
request_timeout => 60
schedule => { cron => "*/5 * * * *"}
	codec => "json"
	metadata_target => "http_metadata"

}
}
filter {
if type[url1] == "JVM_Memory"{
split {
terminator => "\n"
field => "message"
remove_field => "tags"
}
}
if type[url2] == "GC" {
split {
terminator => "\n"
field => "message"
remove_field => "tags"
}
}
}

```

Thanks in Advance.  
Kamal

---

<div class="post-metadata">

**Author:** ![kamalesh](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kamalesh](https://discuss.elastic.co/u/kamalesh)\
**Post date:** [December 9, 2019, 12:25pm UTC](https://discuss.elastic.co/t/how-to-use-type-string-in-a-multiple-input-http-poller-for-different-grok-pattern/210759/2 "2019-12-09T12:25:25Z")

</div>

Hi All ,

Can anyone please help me on my query above.

Thanks in Advance,

Kamaleshwar

---

<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:** [January 6, 2020, 12:39pm UTC](https://discuss.elastic.co/t/how-to-use-type-string-in-a-multiple-input-http-poller-for-different-grok-pattern/210759/3 "2020-01-06T12:39:17Z")

</div>

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