# Query Listener?

**URL:** <https://discuss.elastic.co/t/query-listener/14753>\
**Category:** Elasticsearch\
**Created:** [December 6, 2013, 4:52pm UTC](https://discuss.elastic.co/t/query-listener/14753 "2013-12-06T16:52:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Russo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_russo/32/44835_2.png) [@Roy\_Russo](https://discuss.elastic.co/u/Roy_Russo)\
**Post date:** [December 6, 2013, 4:52pm UTC](https://discuss.elastic.co/t/query-listener/14753/1 "2013-12-06T16:52:14Z")

</div>

Hi All,

Has anyone heard of / or developed a query listener? I'd love to be able to  
aggregate/track the queries flowing through the system as they happen. I  
don't want to go the route of a log appender, as that would require  
monkeying around with slow-query log settings.

Ideally tracking the incoming JSON request would suffice.

Any thoughts?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e7c11e69-1cc2-4f45-bfcb-95aaead7fa38%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e7c11e69-1cc2-4f45-bfcb-95aaead7fa38%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 6, 2013, 6:55pm UTC](https://discuss.elastic.co/t/query-listener/14753/2 "2013-12-06T18:55:30Z")

</div>

Yes, I once started an effort of a pub/sub framework with websockets  
between nodes. By doing this, you could also subscribe to nodes and track  
queries as they are executed somehwere on the cluster (note that queries  
would have to be extended to carry a unique identifier).

> **[jprante/elasticsearch-transport-websocket](https://github.com/jprante/elasticsearch-transport-websocket)**
>
> elasticsearch-transport-websocket - WebSockets for ElasticSearch

There is no current version yet but I plan to jump on the 1.0.0 bandwagon.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFxmAKyFN8OCqPLR25wtn%2BQdowEf9CA5toG9rW0KVpiKw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFxmAKyFN8OCqPLR25wtn%2BQdowEf9CA5toG9rW0KVpiKw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Roy\_Russo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_russo/32/44835_2.png) [@Roy\_Russo](https://discuss.elastic.co/u/Roy_Russo)\
**Post date:** [December 6, 2013, 8:59pm UTC](https://discuss.elastic.co/t/query-listener/14753/3 "2013-12-06T20:59:45Z")

</div>

Makes sense, but not sure I follow... this sort of architecture would lead  
to tracking a lot of duplicate calls, as one query can hit X# nodes before  
returning for result-aggregation. Is this where the uid comes in - for  
de-duplication of calls?

Also, what does 1.0.0 change in this respect?

On Friday, December 6, 2013 1:55:30 PM UTC-5, Jörg Prante wrote:

> Yes, I once started an effort of a pub/sub framework with websockets  
> between nodes. By doing this, you could also subscribe to nodes and track  
> queries as they are executed somehwere on the cluster (note that queries  
> would have to be extended to carry a unique identifier).
> 
> [GitHub - jprante/elasticsearch-transport-websocket: WebSockets for ElasticSearch](https://github.com/jprante/elasticsearch-transport-websocket)
> 
> There is no current version yet but I plan to jump on the 1.0.0 bandwagon.
> 
> Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/df8a0085-0f9e-405a-a3f8-b7ae829ee7d5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/df8a0085-0f9e-405a-a3f8-b7ae829ee7d5%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 6, 2013, 9:21pm UTC](https://discuss.elastic.co/t/query-listener/14753/4 "2013-12-06T21:21:42Z")

</div>

Yes, assigning a uid to a query could assist in collecting all the events  
that belong together. Not really deduplication since all the events stand  
for themselves and give the big picture.

Tracing query execution comes with a certain overhead impact. I'm quite  
sure there will be no such hooks in 1.0.0 to allow this style of a query  
listener where clients can "spy" what other clients are doing.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEmqzeqW9yZthnCSK6NoXoxcuLV\_tgC-fVRnqsK1u4Uxg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEmqzeqW9yZthnCSK6NoXoxcuLV_tgC-fVRnqsK1u4Uxg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:02am UTC](https://discuss.elastic.co/t/query-listener/14753/5 "2017-07-06T02:02:47Z")

</div>


