mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
Use build_where_clause to build where clause
This commit is contained in:
parent
85d0b0cffa
commit
cac020c537
5 changed files with 6 additions and 6 deletions
|
|
@ -148,7 +148,7 @@ function all_alert_store:select_historical(filter, fields)
|
|||
return res
|
||||
end
|
||||
|
||||
where_clause = table.concat(self._where, " AND ")
|
||||
where_clause = self:build_where_clause()
|
||||
|
||||
-- [OPTIONAL] Add sort criteria
|
||||
if self._order_by then
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ end
|
|||
--@brief Performs a query for the top client hosts by alert count
|
||||
function flow_alert_store:top_cli_ip_historical()
|
||||
-- Preserve all the filters currently set
|
||||
local where_clause = table.concat(self._where, " AND ")
|
||||
local where_clause = self:build_where_clause()
|
||||
|
||||
local q = string.format("SELECT cli_ip, cli_name, count(*) count FROM %s WHERE %s GROUP BY cli_ip ORDER BY count DESC LIMIT %u",
|
||||
self._table_name, where_clause, self._top_limit)
|
||||
|
|
@ -103,7 +103,7 @@ end
|
|||
--@brief Performs a query for the top server hosts by alert count
|
||||
function flow_alert_store:top_srv_ip_historical()
|
||||
-- Preserve all the filters currently set
|
||||
local where_clause = table.concat(self._where, " AND ")
|
||||
local where_clause = self:build_where_clause()
|
||||
|
||||
local q = string.format("SELECT srv_ip, srv_name, count(*) count FROM %s WHERE %s GROUP BY srv_ip ORDER BY count DESC LIMIT %u",
|
||||
self._table_name, where_clause, self._top_limit)
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ end
|
|||
--@brief Performs a query for the top hosts by alert count
|
||||
function host_alert_store:top_ip_historical()
|
||||
-- Preserve all the filters currently set
|
||||
local where_clause = table.concat(self._where, " AND ")
|
||||
local where_clause = self:build_where_clause()
|
||||
|
||||
local q = string.format("SELECT ip, name, count(*) count FROM %s WHERE %s GROUP BY ip ORDER BY count DESC LIMIT %u",
|
||||
self._table_name, where_clause, self._top_limit)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ end
|
|||
--@brief Performs a query for the top device address by alert count
|
||||
function mac_alert_store:top_address_historical()
|
||||
-- Preserve all the filters currently set
|
||||
local where_clause = table.concat(self._where, " AND ")
|
||||
local where_clause = self:build_where_clause()
|
||||
|
||||
local q = string.format("SELECT address, count(*) count FROM %s WHERE %s GROUP BY address ORDER BY count DESC LIMIT %u",
|
||||
self._table_name, where_clause, self._top_limit)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ end
|
|||
--@brief Performs a query for the top networks by alert count
|
||||
function network_alert_store:top_local_network_id_historical()
|
||||
-- Preserve all the filters currently set
|
||||
local where_clause = table.concat(self._where, " AND ")
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue