Hi,
I'm using Spring Data Elasticsearch, and so some of the queries are
generated. I'd like to be able to log all queries that hit Elasticsearch,
simply to be able to better understand what is being generated and run.
I found some old (2010) discussions saying that this isn't possible - but
I'm hoping that it might be possible now. It would make a lot of sense to
be able to see these queries (conditionally of course, with a TRACE log
level for example).
Is this possible in any way now?
Cheers,
Eugen.
You can use the "slowlog.log" file to view queries that were sent: it
prints out the JSON of the query received.
This log is off by default and only prints logs for operations that took
longer than durations specific in the elasticsearch.yml config file.
You can turn it on and set the thresholds to a very low value to view all
queries - just remember to return them to reasonable values when you are
done testing.
Also, note that you will need to restart your node for the changes to take
effect.
Here is an example of how I set my local (testing) node to print out all
queries received to the "slowlog" log:
################################## Slow Log
##################################
On Tuesday, November 25, 2014 6:20:35 PM UTC+2, Eugen Paraschiv wrote:
Hi,
I'm using Spring Data Elasticsearch, and so some of the queries are
generated. I'd like to be able to log all queries that hit Elasticsearch,
simply to be able to better understand what is being generated and run.
I found some old (2010) discussions saying that this isn't possible - but
I'm hoping that it might be possible now. It would make a lot of sense to
be able to see these queries (conditionally of course, with a TRACE log
level for example).
Is this possible in any way now?
Cheers,
Eugen.
I did read about that option, thanks for letting me know that it's the way
to go. I though that there would be another way, but since there's not,
I'll go ahead and do that.
Thank you,
Eugen.
On Tue, Nov 25, 2014 at 6:46 PM, Yosi Haran yosi@my6sense.com wrote:
Hi Eugen,
You can use the "slowlog.log" file to view queries that were sent: it
prints out the JSON of the query received.
This log is off by default and only prints logs for operations that took
longer than durations specific in the elasticsearch.yml config file.
You can turn it on and set the thresholds to a very low value to view all
queries - just remember to return them to reasonable values when you are
done testing.
Also, note that you will need to restart your node for the changes to take
effect.
Here is an example of how I set my local (testing) node to print out all
queries received to the "slowlog" log:
################################## Slow Log
##################################
On Tuesday, November 25, 2014 6:20:35 PM UTC+2, Eugen Paraschiv wrote:
Hi,
I'm using Spring Data Elasticsearch, and so some of the queries are
generated. I'd like to be able to log all queries that hit Elasticsearch,
simply to be able to better understand what is being generated and run.
I found some old (2010) discussions saying that this isn't possible - but
I'm hoping that it might be possible now. It would make a lot of sense to
be able to see these queries (conditionally of course, with a TRACE log
level for example).
Is this possible in any way now?
Cheers,
Eugen.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.