Skip to content

Instantly share code, notes, and snippets.

@lcostantini
Created March 17, 2016 15:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcostantini/85d02e421aa2fd69be50 to your computer and use it in GitHub Desktop.
Save lcostantini/85d02e421aa2fd69be50 to your computer and use it in GitHub Desktop.
Configuration file to run Logstash in Bluemix.
input {
http_poller {
urls => {
"bluemix-health-check" => "http://anomaly-detection.mybluemix.net/health-check"
}
automatic_retries => 0
interval => 10
request_timeout => 8
metadata_target => http_poller_metadata
tags => anomaly
codec => "plain"
}
}
filter {
if [http_poller_metadata] {
mutate {
add_field => {
"@status" => "%{http_poller_metadata[code]}"
}
}
}
if [http_poller_metadata][runtime_seconds] and [http_poller_metadata][runtime_seconds] > 0.9 {
mutate {
add_tag => "slow_requests"
}
}
}
output {
elasticsearch {
hosts => ["URL_TO_ELASTICSEARCH_SERVICE"]
user => "USER_SERVICE"
password => "PASSWORD_SERVICE"
# I used the service Searchly in Bluemix and has problem to create the default index "logstash-%{+YYYY.MM.dd}".
index => "logstash-anomaly"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment