# Http\_poller input plugin Logstash solution

**URL:** https://discuss.elastic.co/t/http-poller-input-plugin-logstash-solution/186581
**Category:** Logstash
**Created:** [June 20, 2019, 4:28am UTC](https://discuss.elastic.co/t/http-poller-input-plugin-logstash-solution/186581 "2019-06-20T04:28:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)
#### Post date: [June 20, 2019, 4:28am UTC](https://discuss.elastic.co/t/http-poller-input-plugin-logstash-solution/186581/1 "2019-06-20T04:28:24Z")

</div>

**Background info:**

The objective is to transfer release information of a hardware machine from Balena to Kibana using the following logic:

`Balena JSON data > Logstash > Elasticsearch > Kibana`

I am stuck in the Logstash part 🤔

**Questions:**

1. What is the best/easiest way to perform an API call like this in Logstash? What input plugin do I need to use for it?

2. Where should I place the authentiation token, \<AUTH\_TOKEN\> in my input plugin?

---

<div class="post-metadata">

### Author: ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)
#### Post date: [June 20, 2019, 6:57pm UTC](https://discuss.elastic.co/t/http-poller-input-plugin-logstash-solution/186581/2 "2019-06-20T18:57:54Z")

</div>

Note: The curl command that I was executing on the command line was like this:

```
curl -X GET \
"https://api.balena-cloud.com/v4/release?\$filter=belongs_to__application%20eq%20<APP ID>" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 

```

Then to do it for Logstash I used the following input plugin solution.

**Solution:**

```auto
input{
  http_poller {
    urls => {      
      authentication => {
        method => get
        user => "myEmailAddress"
        password => "myPassword"
        url => "https://api.balena-cloud.com/v4/release?$filter=belongs_to__application%20eq%20<APP ID>"
        headers => {
          "Content-Type" => "application/json"
          "Authorization" => "Bearer <AUTH_TOKEN>"
        }
      }
    }
    request_timeout => 60
    schedule => { every => "5s"}
    codec => "json"
  }
} 

output{
  stdout { 
    codec => rubydebug 
  }
}

```

---

<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: [July 18, 2019, 8:31pm UTC](https://discuss.elastic.co/t/http-poller-input-plugin-logstash-solution/186581/5 "2019-07-18T20:31:19Z")

</div>

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