# Retrieve metricbeat parameters from Elasticsearch using java Rest high level client

**URL:** <https://discuss.elastic.co/t/retrieve-metricbeat-parameters-from-elasticsearch-using-java-rest-high-level-client/251416>\
**Category:** Elasticsearch\
**Created:** [October 8, 2020, 10:48am UTC](https://discuss.elastic.co/t/retrieve-metricbeat-parameters-from-elasticsearch-using-java-rest-high-level-client/251416 "2020-10-08T10:48:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pathfinder225](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@pathfinder225](https://discuss.elastic.co/u/pathfinder225)\
**Post date:** [October 8, 2020, 10:48am UTC](https://discuss.elastic.co/t/retrieve-metricbeat-parameters-from-elasticsearch-using-java-rest-high-level-client/251416/1 "2020-10-08T10:48:53Z")

</div>

Hi Team,

We have to retrieve below parameters from our metric beat index from elasticsearch, index pattern would look like something like metricbeat-_appId_

All these parameters are not present in single document they are spread across multiple documents. I want to retrieve latest documents which contains below paramters using Java Rest High Client , but wondering which api to use , can you please throw some light on the approach.

parameters below,

system.memory  
system.cpu  
system.process  
system.fsstat  
system.filesystem  
system.load  
system.socket.summary  
system.process.summary  
system.network

EDIT: after some research I should use Search API and Query Builder to achieve what I need, however I want to filter multiple documents which contain different fields. So how to use QueryBuider for the same?

field1 in document 1  
field2 in document2  
field3 in document 3

all fields to be matched in individual document rather than in same document.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/e/8e9e5eeb1141ab8fb76bbb1788d64cbe55dfe72a.png)

---

<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:** [November 5, 2020, 10:49am UTC](https://discuss.elastic.co/t/retrieve-metricbeat-parameters-from-elasticsearch-using-java-rest-high-level-client/251416/2 "2020-11-05T10:49:31Z")

</div>

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