Http_poller not able to handle 302

I have an url ( lets say URL1, this is just http ) which just redirects to another url ( lets say URL2, this is https ) on invoking. When I try invoking the URL1 via curl , it clearly gives me 302 . But when I do this via http_poller, it's not giving any response.

Here is my logstash conf for input http_poller.

input {
  http_poller {
    urls => {
      "ES Instance" => "http://localhost:9200"
      "My URL" => "URL1"
    }   
    follow_redirects => false
    request_timeout => 60
    schedule => { "every" => "10s"}
    codec => plain
    metadata_target => "http_poller_metadata"
  }
}
output {
  stdout {
    codec => rubydebug
  }
}

Here is the what I'm seeing in output.

{
              "@timestamp" => 2019-06-18T11:33:18.021Z,
                "@version" => "1",
                    "tags" => [
        [0] "_http_request_failure"
    ],
    "http_poller_metadata" => {
                   "name" => "My URL",
                   "host" => "My Host Id",
        "runtime_seconds" => nil,
                "request" => {
               "url" => "My URL",
            "method" => "get"
        }
    },
    "http_request_failure" => {
                  "error" => "SSL peer shut down incorrectly",
                   "name" => "My URL",
        "runtime_seconds" => 1.064,
              "backtrace" => nil,
                "request" => {
               "url" => "URL1",
            "method" => "get"
        }
    }
}

Can you please assist with this.

You said you expect to get a redirect but have told the input not to follow it.

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