# Query metrics of VMS through API call via HTTP Poller

**URL:** https://discuss.elastic.co/t/query-metrics-of-vms-through-api-call-via-http-poller/244569
**Category:** Logstash
**Created:** [August 11, 2020, 2:27pm UTC](https://discuss.elastic.co/t/query-metrics-of-vms-through-api-call-via-http-poller/244569 "2020-08-11T14:27:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ayesha](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Ayesha](https://discuss.elastic.co/u/Ayesha)
#### Post date: [August 11, 2020, 2:27pm UTC](https://discuss.elastic.co/t/query-metrics-of-vms-through-api-call-via-http-poller/244569/1 "2020-08-11T14:27:16Z")

</div>

Hi

I want to grab specific metrics of VMs by API calls  
Currently I am using _ **///suite-api/api/resources?resourceKind=VirtualMachine** _ to call all VMs and their resource IDs in postman  
Next I am using below to get metrics  
**///suite-api/api/resources/{resourceID}/properties**

I have all the resourceIds I need, I want to send another request to query for some metrics. I am using below link as reference  
_[https://blogs.vmware.com/management/2019/02/extracting-data-from-vrealize-operations-with-the-rest-apis.html](https://blogs.vmware.com/management/2019/02/extracting-data-from-vrealize-operations-with-the-rest-apis.html)_

But I want to query this via logstash. Any help would be really appreciated.

---

<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: [August 11, 2020, 3:50pm UTC](https://discuss.elastic.co/t/query-metrics-of-vms-through-api-call-via-http-poller/244569/2 "2020-08-11T15:50:53Z")

</div>

I would use an exec input running /bin/true with a schedule so that you can get an event down the pipeline as often as you need, then use http filters to make the REST calls.

---

<div class="post-metadata">

### Author: ![Ayesha](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Ayesha](https://discuss.elastic.co/u/Ayesha)
#### Post date: [August 11, 2020, 5:37pm UTC](https://discuss.elastic.co/t/query-metrics-of-vms-through-api-call-via-http-poller/244569/3 "2020-08-11T17:37:26Z")

</div>

But there are like 5000+ VMs with unique resource ids. It will be not practical to call each individual resource ID. I am looking for some kind of script to parse it via logstash.

---

<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: [August 11, 2020, 6:32pm UTC](https://discuss.elastic.co/t/query-metrics-of-vms-through-api-call-via-http-poller/244569/4 "2020-08-11T18:32:48Z")

</div>

Sorry, I was assuming you could get a list of VM and resources using an API call, then split that as appropriate.

---

<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: [September 8, 2020, 6:33pm UTC](https://discuss.elastic.co/t/query-metrics-of-vms-through-api-call-via-http-poller/244569/5 "2020-09-08T18:33:06Z")

</div>

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