How to use Type string in a multiple input Http_Poller for different Grok pattern

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

Hi All ,

Can anyone please help me on my query above.

Thanks in Advance,

Kamaleshwar

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