# Problem with logstash http\_poller plugin

**URL:** https://discuss.elastic.co/t/problem-with-logstash-http-poller-plugin/120232
**Category:** Logstash
**Created:** [February 16, 2018, 6:29pm UTC](https://discuss.elastic.co/t/problem-with-logstash-http-poller-plugin/120232 "2018-02-16T18:29:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kabali12345](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kabali12345](https://discuss.elastic.co/u/kabali12345)
#### Post date: [February 16, 2018, 6:29pm UTC](https://discuss.elastic.co/t/problem-with-logstash-http-poller-plugin/120232/1 "2018-02-16T18:29:38Z")

</div>

Hi all here i am trying to call rest API with http\_poller plugin.  
Here is my logstash conf

```auto
input {
  http_poller {
    urls => {
      test2 => {
        method => get
        user => "XXXX"
        password => "XXXX"
        url => "https://XXX.XXX.XXX.XXX:8021/api/v2/alerts"
        headers => {
          Accept => "application/json"
        }
     }
    }
    request_timeout => 60
    schedule => { cron => "* * * * * UTC"}
    codec => "json"
    metadata_target => "http_poller_metadata"
# verify_cert => true
# ssl_certificate_validation => true
 # truststore => "/root/truststore.jks"
  # truststore_password => "access"
  }
}

output {
  stdout {
    codec => rubydebug
  }
}

```

where i am getting following error in result of logstash

```auto
[2018-02-16T10:59:10,216][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9601}
{
    "http_request_failure" => {
                "request" => {
            "headers" => {
                "Accept" => "application/json"
            },
             "method" => "get",
               "auth" => {
                "eager" => true,
                 "pass" => "XXXX",
                 "user" => "XXXX"
            },
                "url" => "https://XXX.XXX.XXX.XXX:8021/api/v2/alerts"
        },
              "backtrace" => nil,
        "runtime_seconds" => 0.861,
                   "name" => "test2",
                  "error" => **"PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"**
    },
              "@timestamp" => 2018-02-16T16:00:01.176Z,
                "@version" => "1",
    "http_poller_metadata" => {
                "request" => {
            "headers" => {
                "Accept" => "application/json"
            },
             "method" => "get",
               "auth" => {
                "eager" => true,
                 "pass" => "XXXX",
                 "user" => "XXXX"
            },
                "url" => "https://XXX.XXX.XXX.XXX:8021/api/v2/alerts"
        },
        "runtime_seconds" => nil,
                   "name" => "test2",
                   "host" => "sgplubuntu1604"
    },
                    "tags" => [
        [0] "_http_request_failure"
    ]
}

```

i have also tried to add truststore files in configuration but still am getting same error.  
but same configuration is working for **HTTP** Protocol, where i have used elasticsearch rest api [http://XXX.XXX.XXX.XXX:9233/\_cluster/health/](http://XXX.XXX.XXX.XXX:9233/_cluster/health/).

did i miss something here in my logstash conf...?

Thank You.

---

<div class="post-metadata">

### Author: ![kabali12345](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kabali12345](https://discuss.elastic.co/u/kabali12345)
#### Post date: [February 20, 2018, 5:48pm UTC](https://discuss.elastic.co/t/problem-with-logstash-http-poller-plugin/120232/2 "2018-02-20T17:48:02Z")

</div>

Hi all is there any work around this error...?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 20, 2018, 5:48pm UTC](https://discuss.elastic.co/t/problem-with-logstash-http-poller-plugin/120232/3 "2018-03-20T17:48:10Z")

</div>

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