Trying to get data to elasticsearch from appdynamics api using logstash below configuration is used
input {
http_poller {
urls => {
appdynamics =>{
method => "GET"
url => "https://cognizant-nfr.saas.appdynamics.com/controller/rest/applications?output=JSON"
auth => {
user => "******"
password => "*****"
}
}
}
request_timeout => 30
# Supports "cron", "every", "at" and "in" schedules by rufus scheduler
schedule => { cron => " * * * * UTC"}
codec => "json"
#codec => "plain"
#metadata_target => "http_poller_metadata"
}
}
filter {
json{
source => "message"
}
}
#send data to ES
output {
elasticsearch { hosts => ["localhost:9200"]
index => "api_appdynamics_test" }
stdout { codec => rubydebug }
}
and getting below error while trying to run via commandline
"http_request_failure" => {
"name" => "appdynamics",
"request" => {
"auth" => {
"pass" => "",
"user" => "*****",
"eager" => true
},
"url" => "https://cognizant-nfr.saas.appdynamics.com/controller/rest/applications?output=JSON",
"method" => "get"
},
"backtrace" => nil,
"error" => "Connection refused: connect",
"runtime_seconds" => 1.054
},
"@version" => "1",
"@timestamp" => 2019-08-29T10:16:01.148Z,
"tags" => [
[0] "_http_request_failure"
]
}