# How to print the raw JSON query

**URL:** <https://forum.opensearch.org/t/how-to-print-the-raw-json-query/13991>\
**Category:** OpenSearch Client Libraries\
**Tags:** opensearch-java\
**Created:** [April 18, 2023, 1:44pm UTC](https://forum.opensearch.org/t/how-to-print-the-raw-json-query/13991 "2023-04-18T13:44:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonardo89](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@leonardo89](https://forum.opensearch.org/u/leonardo89)\
**Post date:** [April 18, 2023, 1:44pm UTC](https://forum.opensearch.org/t/how-to-print-the-raw-json-query/13991/1 "2023-04-18T13:44:41Z")

</div>

**Versions** (latest):

**Describe the issue** :  
I just want to know if there is a way to print tha raw query JSON

---

<div class="post-metadata">

**Author:** ![wbeckler](https://avatars.discourse-cdn.com/v4/letter/w/9d8465/32.png) [@wbeckler](https://forum.opensearch.org/u/wbeckler)\
**Post date:** [April 19, 2023, 11:51pm UTC](https://forum.opensearch.org/t/how-to-print-the-raw-json-query/13991/2 "2023-04-19T23:51:39Z")

</div>

Can you explain more your setup and what you’re trying to do?

---

<div class="post-metadata">

**Author:** ![leonardo89](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@leonardo89](https://forum.opensearch.org/u/leonardo89)\
**Post date:** [April 22, 2023, 11:36am UTC](https://forum.opensearch.org/t/how-to-print-the-raw-json-query/13991/3 "2023-04-22T11:36:55Z")

</div>

I’m using the latest version of the Java client, steps:  
1- Create a search request  
2- Print the search request in JSON format

I want to know how to perform the 2nd step.

---

<div class="post-metadata">

**Author:** ![wbeckler](https://avatars.discourse-cdn.com/v4/letter/w/9d8465/32.png) [@wbeckler](https://forum.opensearch.org/u/wbeckler)\
**Post date:** [April 25, 2023, 8:30pm UTC](https://forum.opensearch.org/t/how-to-print-the-raw-json-query/13991/4 "2023-04-25T20:30:54Z")

</div>

I haven’t tried this, but a little googling revealed this possibility: [Log4j 2 Logger | Java Transport Client (deprecated) [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_log4j_2_logger.html)

Maybe with “debug” level

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [June 24, 2023, 8:31pm UTC](https://forum.opensearch.org/t/how-to-print-the-raw-json-query/13991/5 "2023-06-24T20:31:48Z")

</div>

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