Hello,
Can someone give me a simple HTTP poller config to check the 200 response on my URL.
with a filter to check response output.
I tried creating config but its not working .
Thanks in Advance
Hello,
Can someone give me a simple HTTP poller config to check the 200 response on my URL.
with a filter to check response output.
I tried creating config but its not working .
Thanks in Advance
Please show us what you have so far and what you get when you use that configuration. Add a stdout { codec => rubydebug { metadata => true } }
output to get the results.
Hello,
Below is my conf file
"@host" => "%{http_poller_metadata[name]}"
}
}
}
}
filter {
if [http_poller_metadata][runtime_seconds] and [http_poller_metadata][runtime_seconds] > 0.5 {
mutate {
add_tag => "slow_request"
}
}
}
filter {
if [http_request_failure] or
[http_poller_metadata][code] != 200 {
# Tag all these events as being bad
mutate {
add_tag => "bad_request"
}
}
}
output {
#}
#}
stdout { codec => rubydebug { metadata => true } }
62,1 Bot
Your post is incomplete and doesn't include all configuration. You also did no include what you currently get from the stdout output (I suggest you disable the elasticsearch output for now while we debug this).
Hello,
When i execute
sudo /opt/logstash/bin/logstash -f /etc/logstash/conf.d/logstash-http.conf
I get this output on the screen
Error: Expected one of #, if, ", ', } at line 64, column 1 (byte 1430) after output {
#}
#}
stdout { codec => rubydebug { metadata => true } }
{:level=>:error}
The content of logstash-http.conf
input {
http_poller {
urls => {
"localhost" => "http://www.google.com"
}
automatic_retries => 0
# Check the site every 10s
interval => 10
# Wait no longer than 8 seconds for the request to complete
request_timeout => 8
# Store metadata about the request in this field
metadata_target => http_poller_metadata
# Tag this request so that we can throttle it in a filter
tags => website_healthcheck
}
}
filter {
if [http_poller_metadata] {
mutate {
add_field => {
"@host" => "%{http_poller_metadata[name]}"
}
}
}
}
filter {
if [http_poller_metadata][runtime_seconds] and [http_poller_metadata][runtime_seconds] > 0.5 {
mutate {
add_tag => "slow_request"
}
}
}
filter {
if [http_request_failure] or
[http_poller_metadata][code] != 200 {
# Tag all these events as being bad
mutate {
add_tag => "bad_request"
}
}
}
output {
#}
#}
stdout { codec => rubydebug { metadata => true } }
Error: Expected one of #, if, ", ', } at line 64, column 1 (byte 1430) after output {
So... what on line 64 of the configuration file?
If you format your configuration file as code with the </>
so that it's readable and won't get munged I can have a look at it myself.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.