# Print ElasticSearch logs in java console

**URL:** <https://discuss.elastic.co/t/print-elasticsearch-logs-in-java-console/169710>\
**Category:** Elasticsearch\
**Created:** [February 24, 2019, 9:26am UTC](https://discuss.elastic.co/t/print-elasticsearch-logs-in-java-console/169710 "2019-02-24T09:26:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![compsecstudent](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@compsecstudent](https://discuss.elastic.co/u/compsecstudent)\
**Post date:** [February 24, 2019, 9:26am UTC](https://discuss.elastic.co/t/print-elasticsearch-logs-in-java-console/169710/1 "2019-02-24T09:26:46Z")

</div>

I want to use the logs from the Get request below in my my Maven JavaFX application, for now I just want to print the data out to console (and then move on to adding it into an array). Would this be possible?

I've tried using QueryBuilder, SearchRequest and SearchHits and can't get back any results (think I'm writing it incorrectly).

Thanks in advance.

```auto
{
"query": {
"bool": {
"should": [
{ "match": { "beat.name": "windows-control-1"}},
{ "match": { "beat.name": "windows-control-2"}},
{ "match": { "beat.name": "windows-control-3" }},
{ "match": { "beat.name": "windows-control-4" }},
{ "match": { "beat.name": "windows-control-5" }}
]
}
},
"_source": ["event_id", "hour"],
"size": 100,
"sort" : [{ "hour.keyword" : {"order" : "asc"}}]
}

```

---

<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:** [March 24, 2019, 9:35am UTC](https://discuss.elastic.co/t/print-elasticsearch-logs-in-java-console/169710/2 "2019-03-24T09:35:51Z")

</div>

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