# Fetching warnings from Elasticsearch response

**URL:** <https://discuss.elastic.co/t/fetching-warnings-from-elasticsearch-response/335903>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [June 13, 2023, 6:45pm UTC](https://discuss.elastic.co/t/fetching-warnings-from-elasticsearch-response/335903 "2023-06-13T18:45:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Schneider](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_schneider/32/77408_2.png) [@Daniel\_Schneider](https://discuss.elastic.co/u/Daniel_Schneider)\
**Post date:** [June 13, 2023, 6:45pm UTC](https://discuss.elastic.co/t/fetching-warnings-from-elasticsearch-response/335903/1 "2023-06-13T18:45:27Z")

</div>

Hi,

Is it possible to fetch warnings from Elasticsearch response in JAVA? E.g., when Elasticsearch security is not enabled rest client logs appropriate warning that comes with response:

_[WARN] o.e.c.RestClient - request [GET [http://127.0.0.1:9200/](http://127.0.0.1:9200/)] returned 1 warnings: [299 Elasticsearch-7.15.2-93d5a7f6192e8a1a12e154a2b81bf6fa7309da0c "Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See [Set up minimal security for Elasticsearch | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/security-minimal-setup.html) to enable security."]_

My question is if there is JAVA API that can fetch this warning from the response by code?

Thank you in advance,  
Daniel

---

<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 11, 2023, 6:45pm UTC](https://discuss.elastic.co/t/fetching-warnings-from-elasticsearch-response/335903/2 "2023-07-11T18:45:57Z")

</div>

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