# Logging queries run via search templates

**URL:** <https://discuss.elastic.co/t/logging-queries-run-via-search-templates/21742>\
**Category:** Elasticsearch\
**Created:** [January 21, 2015, 3:28am UTC](https://discuss.elastic.co/t/logging-queries-run-via-search-templates/21742 "2015-01-21T03:28:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [January 21, 2015, 3:28am UTC](https://discuss.elastic.co/t/logging-queries-run-via-search-templates/21742/1 "2015-01-21T03:28:04Z")

</div>

Hi,  
I am running some template search queries on 1.4.2 via Java APIs like so:

esClient.prepareSearch(index)  
.setTemplateName(templateName)  
.setTemplateParams(templateParams)  
.setTemplateType(ScriptService.ScriptType.INDEXED)

When I log the request, I get an empty json object. Is it possible to dump  
the the actual evaluated query from the node client? I dug through the code  
and it looks to me the template is evaluated in SearchService.java, but  
didn't see a clean way to extract that out.

I am pretty sure I can logs this out server side, but was hoping to get  
this info from the caller.

Thanks!  
Paul

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/89dabe98-60b6-47b1-a95a-3a4782445766%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/89dabe98-60b6-47b1-a95a-3a4782445766%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:37am UTC](https://discuss.elastic.co/t/logging-queries-run-via-search-templates/21742/2 "2017-07-06T00:37:36Z")

</div>

Closed on July 6, 2017, 12:37am UTC


