# Consume a rest Api like openweather websites by logstash to store in elasticsearch

**URL:** <https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850>\
**Category:** Logstash\
**Created:** [May 13, 2019, 4:52pm UTC](https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850 "2019-05-13T16:52:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![decodeit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/decodeit/32/46023_2.png) [@decodeit](https://discuss.elastic.co/u/decodeit)\
**Post date:** [May 13, 2019, 4:52pm UTC](https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850/1 "2019-05-13T16:52:21Z")

</div>

I am new to elasticsearch. What I am looking for is to be able to call any external webservices like openweather which requires any api key or either id and password, and be able to consume the response by logstash in json.

my goal is to store this info in the elasticsearch.  
Also if i could filter the data when i receive in logstash before storing in elasticSearch.  
Is there any tool or way to do this.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 13, 2019, 5:00pm UTC](https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850/2 "2019-05-13T17:00:15Z")

</div>

You might be able to do it with an [http\_poller](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html) input.

For some use cases that does not work and you might have to use an [http](https://www.elastic.co/guide/en/logstash/current/plugins-filters-http.html) filter. In that case you would need some other input to generate events, which might be as simple as

```
input { generator { count => 1 message => '' } }

```

logstash can certainly support many such use cases. If you search this forum for the word openweather you will find examples of folks doing this and their configurations.

---

<div class="post-metadata">

**Author:** ![decodeit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/decodeit/32/46023_2.png) [@decodeit](https://discuss.elastic.co/u/decodeit)\
**Post date:** [May 13, 2019, 5:03pm UTC](https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850/3 "2019-05-13T17:03:09Z")

</div>

Thanks for the prompt reply. I will look in to it.

---

<div class="post-metadata">

**Author:** ![decodeit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/decodeit/32/46023_2.png) [@decodeit](https://discuss.elastic.co/u/decodeit)\
**Post date:** [May 16, 2019, 11:56am UTC](https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850/4 "2019-05-16T11:56:14Z")

</div>

Does this need something like filebeat. or logstash can take json from the webservices directly and feed to elasticsearch

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 16, 2019, 12:11pm UTC](https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850/5 "2019-05-16T12:11:40Z")

</div>

No need for filebeat.

---

<div class="post-metadata">

**Author:** ![decodeit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/decodeit/32/46023_2.png) [@decodeit](https://discuss.elastic.co/u/decodeit)\
**Post date:** [May 16, 2019, 12:34pm UTC](https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850/6 "2019-05-16T12:34:23Z")

</div>

Thanks

---

<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:** [June 13, 2019, 12:34pm UTC](https://discuss.elastic.co/t/consume-a-rest-api-like-openweather-websites-by-logstash-to-store-in-elasticsearch/180850/7 "2019-06-13T12:34:30Z")

</div>

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