Logging Search Queries Made on ElasticSearch

I would like to know if there is a way to log all the search queries made against our Elasticsearch cluster. I assume it might be possible by changing the log level of one of the logging hierarchies as described here but I don't know where I can find a description of all the hierarchies.

I am asking this because we want to do ingestion optimization by changing the field types to minimize the use of processors. To be able to do that, I need to review how fields are being used.

Thank you

It seems that logging hierarchies are not documented.

I found the hierarchies I needed by setting globally the log level to critical in elasticsearch.yml:
logger.level: CRITICAL.
Then by looking at the logs, I found the lines I needed (for example: o.e.s.q.QueryPhase).
Then on GitLab I found QueryPhase.java and by looking at the folder hierarchy I found out what means o.e.s.f.

tl;dr:
logger.org.elasticsearch.tasks.TaskManager: trace logger.org.elasticsearch.search.query.QueryPhase: trace logger.org.elasticsearch.search.fetch.FetchPhase: trace

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