The pagerduty plugin is not working for me. It cannot resolve the fields, so I cannot make it programmatic and was wondering if anyone can assist me?
input {
http_poller {
urls => {
pagerTest => "http://example.com"
}
automatic_retries => 0
# Check the site every 10s
schedule => { "every" => "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
codec => plain
}
}
filter {
# The poller doesn't set an '@host' field because it may or may not have meaning
# In this case we can set it to the 'name' of the host which will be 'localhost'
# The name is the key used in the poller's 'url' config
if [http_poller_metadata] {
mutate {
rename => { "[http_poller_metadata][request][url]" => "component_url" }
}
if [http_poller_metadata][name] == "pagerTest" {
mutate {
add_field => {
"component_name" => "PagerDuty - test"
"integration_key" => "RANDOMKEY"
"event_type" => "trigger"
}
}
}
}
}
output {
stdout { codec => rubydebug }
pagerduty {
service_key => "%{integration_key}"
incident_key => "logstash/MySQLTimeline/StatusPage"
description => "Logstash is unable to connect to %{event_type} %{integration_key}"
details => {
"timestamp"=>"%{@timestamp}"
"message"=>"Logstash test"
}
event_type => "%{event_type}"
}
}
integration_key and event_type print properly in the description field, but it will not resolve the fields like this. The configuration works if I hard code them. integration_key doesn't actually throw error as it just looks for %{integration_key} (and doesn't find it), but event_type fails it is not able to resolve to trigger