# View query created by HL Rest Client

**URL:** <https://discuss.elastic.co/t/view-query-created-by-hl-rest-client/242870>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [July 28, 2020, 9:30am UTC](https://discuss.elastic.co/t/view-query-created-by-hl-rest-client/242870 "2020-07-28T09:30:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sutty100](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@sutty100](https://discuss.elastic.co/u/sutty100)\
**Post date:** [July 28, 2020, 9:30am UTC](https://discuss.elastic.co/t/view-query-created-by-hl-rest-client/242870/1 "2020-07-28T09:30:57Z")

</div>

I can't find a way to output the query created by the Java 7.8 High level Rest Client. I want to take the query and explain it/debug it in Kibana dev tools. However without an easy way to output the query being sent to elastic I am going to need to decode the query built up in Java and hand write it. I could turn on the slow query log and grab it from the logs but it feels like there should be a simpler way to do this that I am missing!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2020, 9:44am UTC](https://discuss.elastic.co/t/view-query-created-by-hl-rest-client/242870/2 "2020-07-28T09:44:17Z")

</div>

I think you can use the `toString()` method on a `QueryBuilder`.

---

<div class="post-metadata">

**Author:** ![sutty100](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@sutty100](https://discuss.elastic.co/u/sutty100)\
**Post date:** [July 28, 2020, 10:23am UTC](https://discuss.elastic.co/t/view-query-created-by-hl-rest-client/242870/3 "2020-07-28T10:23:28Z")

</div>

I really don't know why I didn't think to try that!!! 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:** [August 25, 2020, 10:23am UTC](https://discuss.elastic.co/t/view-query-created-by-hl-rest-client/242870/4 "2020-08-25T10:23:41Z")

</div>

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