mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 16:30:10 +00:00
Fix top_local_network_id_historical with clickhouse (#6046)
This commit is contained in:
parent
f22fb26f7f
commit
b277d36ae7
1 changed files with 8 additions and 2 deletions
|
|
@ -92,8 +92,14 @@ function network_alert_store:top_local_network_id_historical()
|
|||
-- Preserve all the filters currently set
|
||||
local where_clause = self:build_where_clause()
|
||||
|
||||
local q = string.format("SELECT local_network_id, count(*) count, name FROM %s WHERE %s GROUP BY local_network_id ORDER BY count DESC LIMIT %u",
|
||||
self._table_name, where_clause, self._top_limit)
|
||||
local q
|
||||
if ntop.isClickHouseEnabled() then
|
||||
q = string.format("SELECT local_network_id, count(*) count, name FROM %s WHERE %s GROUP BY local_network_id, name ORDER BY count DESC LIMIT %u",
|
||||
self._table_name, where_clause, self._top_limit)
|
||||
else
|
||||
q = string.format("SELECT local_network_id, count(*) count, name FROM %s WHERE %s GROUP BY local_network_id ORDER BY count DESC LIMIT %u",
|
||||
self._table_name, where_clause, self._top_limit)
|
||||
end
|
||||
|
||||
local q_res = interface.alert_store_query(q) or {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue