# Complex search query help - Kindly!

**URL:** <https://discuss.elastic.co/t/complex-search-query-help-kindly/173839>\
**Category:** Elasticsearch\
**Created:** [March 26, 2019, 1:10am UTC](https://discuss.elastic.co/t/complex-search-query-help-kindly/173839 "2019-03-26T01:10:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frrrrrunkis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frrrrrunkis/32/42750_2.png) [@Frrrrrunkis](https://discuss.elastic.co/u/Frrrrrunkis)\
**Post date:** [March 26, 2019, 1:10am UTC](https://discuss.elastic.co/t/complex-search-query-help-kindly/173839/1 "2019-03-26T01:10:11Z")

</div>

HI All

putting together elasticsearch / heartbeat with a angtular dashboard as a frontend.

I would like to return all monitors with the monitor name , last status ( monitor.status ) and percent uptime over the last day and last week. Is this possible with a single search query ?

Here is one of the heartbeats documents json

{  
"\_index": "heartbeat-6.1.1-2019.03.26",  
"\_type": "doc",  
"\_id": "\_GyIt2kB12bQLuf-ay84",  
"\_version": 1,  
"\_score": null,  
"\_source": {  
"@timestamp": "2019-03-26T01:06:03.723Z",  
"http": {  
"rtt": {  
"response\_header": {  
"us": 1962  
},  
"validate": {  
"us": 2034  
},  
"content": {  
"us": 71  
},  
"total": {  
"us": 2429  
},  
"write\_request": {  
"us": 87  
}  
},  
"url": "[http://elasticsearch:9200](http://elasticsearch:9200)",  
"response": {  
"status": 200  
}  
},  
"monitor": {  
"type": "http",  
"duration": {  
"us": 3309  
},  
"id": "http@[http://elasticsearch:9200](http://elasticsearch:9200)",  
"scheme": "http",  
"name": "http",  
"host": "elasticsearch",  
"ip": "172.19.0.4",  
"status": "up"  
},  
"resolve": {  
"host": "elasticsearch",  
"ip": "172.19.0.4",  
"rtt": {  
"us": 787  
}  
},  
"type": "monitor",  
"beat": {  
"name": "heartbeat",  
"hostname": "heartbeat",  
"version": "6.1.1"  
},  
"tcp": {  
"rtt": {  
"connect": {  
"us": 332  
}  
},  
"port": 9200  
}  
},  
"fields": {  
"@timestamp": [  
"2019-03-26T01:06:03.723Z"  
]  
},  
"sort": [  
1553562363723  
]  
}

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:** [April 23, 2019, 1:10am UTC](https://discuss.elastic.co/t/complex-search-query-help-kindly/173839/2 "2019-04-23T01:10:13Z")

</div>

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