Logstach http_pool input plugin

Dear experts,

logstash 5.4.1

i am trying use the logstach http_pool plugin to get the http response. as i like use the following command to take the test. it working fine and get the json response.

curl -k -H "content-type: application/json" -XPOST 'https://100.112.20.30:8080/dM/rest/xxxx/sessions' -d '{
"username":"admin",
"password":"admin",
"scope":0
}'

once i do the configuration in the conf file, it's never get the right response, i am not sure where is wrong:

input {
http_poller {
urls => {
Http183 => {
# Supports all options supported by ruby's Manticore HTTP client
method => "POST"
url => "https://100.112.20.30:8080/dM/rest/xxxx/sessions'"
header => {
"Content-Type" => "Application/Json;charset=uft-8"
"Cache-Control" => "no-cache"
"connection" => "keep-alive"
"Accept-Language" => "zh_cn"
}
add_field => {
"username" => "admin"
"password" => "admin"
"scope" => 0
}
}
}
request_timeout => 60
# Supports "cron", "every", "at" and "in" schedules by rufus scheduler
codec => "json"
# A hash of request metadata info (timing, response headers, etc.) will be sent here
metadata_target => "http_poller_metadata"
interval => 600
ssl_certificate_validation => false
}
}

output {
elasticsearch { hosts => [ "127.0.0.1:9200" ] index => "httpool-%{+YYYY}" }
}

thanks for your help in advance, hope to get your good soluation.

thanks

You haven't configured Logstash to include anything in the body of the POST request (the JSON blob with username, password, and scope in your curl example). I don't think the http_poller input supports that.

"Content-Type" => "Application/Json;charset=uft-8"

"Content-Type" => "application/json;charset=utf-8"

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