Search code examples
debuggingelasticsearchelasticsearch-pluginelasticsearch-queryelasticsearch-api

How to visualize Elasticsearch excuted queries history


Hello Elasticsearchers,

I am new with Elasticsearch, I search a proposition to allow me debug the excuted queries because I am working with an elasticsearch PHP API so I want to visualize the body of excuted queries by Elasticsearch.

I tried that plug-in https://github.com/sonian/elasticsearch-jetty , but it seems old and I am working with elasticseach version 6.7.1, so I didn't get it to work.

Any suggestions? Thanks.


Solution

  • Just 3 easy steps:

    1. Configure the Slow Query Log (https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html) with a treshold of 0 in order to have all queries logged.
    2. Ingest the mentioned logfile into Elastisearch using Filebeat, Logstash or something else suits you.
    3. Analyse / Monitor the queries using Kibana, Grafana or something else...

    Have Fun!