vernemq icon indicating copy to clipboard operation
vernemq copied to clipboard

[Bug]: VerneMQ Admin session show command not filtering by topics

Open ManusoGalan opened this issue 1 year ago • 2 comments

Environment

  • VerneMQ Version: 1.13.0
  • OS: Ubuntu 22.04.5
  • Erlang/OTP version (if building from source):
  • Cluster size/standalone: 2 nodes

Current Behavior

I have a VerneMQ cluster where the topics are usually in the form of numbers (like 909) and when I run vmq-admin session show --topic --client_id --is_online --is_online=true

I get something like (there are other clients/topics but it works for the example):

+------------------------+-----------+----------+
| client_id              | is_online | topic    |
+------------------------+-----------+----------+
| s_01743588989403       | true      | 909      |
+------------------------+-----------+----------+
| s_01743588989403       | true      | 910      |
+------------------------+-----------+----------+
| s_01743588989403       | true      | 911      |
+------------------------+-----------+----------+

but when I run (with any topic number) vmq-admin session show --topic --client_id --is_online --is_online=true --topic=909 I always get an empty list

Expected behaviour

If when running vmq-admin session show --topic --client_id --is_online --is_online=true I get something like

+------------------------+-----------+----------+
| client_id              | is_online | topic    |
+------------------------+-----------+----------+
| s_01743588989403       | true      | 909      |
+------------------------+-----------+----------+
| s_01743588989403       | true      | 910      |
+------------------------+-----------+----------+
| s_01743588989403       | true      | 911      |
+------------------------+-----------+----------+

when running vmq-admin session show --topic --client_id --is_online --is_online=true --topic=909 I should get something like

+------------------------+-----------+----------+
| client_id              | is_online | topic    |
+------------------------+-----------+----------+
| s_01743588989403       | true      | 909      |
+------------------------+-----------+----------+

Configuration, logs, error output, etc.


Code of Conduct

  • [x] I agree to follow the VerneMQ's Code of Conduct

ManusoGalan avatar Apr 09 '25 08:04 ManusoGalan

@ManusoGalan Thanks for reporting. Seems like a bug, yes. (maybe the query parser taking this as an integer directly)


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq 👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

ioolkos avatar Apr 09 '25 10:04 ioolkos

As a workaround till this is fixed you could use

topic=~0909$

mths1 avatar Apr 10 '25 13:04 mths1