Fetching warnings from Elasticsearch response


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] 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 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,

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