mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
Major code rework to fully use the clickhouse API in place of Mysql
This commit is contained in:
parent
effde04657
commit
6f9d7cd14f
14 changed files with 17 additions and 70 deletions
|
|
@ -1208,31 +1208,6 @@ function alert_store:select_historical(filter, fields, download --[[ Available o
|
|||
-- res = interface.alert_store_query(q, true)
|
||||
res = interface.alert_store_query(q, true, true) -- Limit results to the max set in the backend
|
||||
|
||||
if ntop.isClickHouseEnabled() and not prefs.native_clickhouse_client_enabled then
|
||||
-- convert DATETIME to epoch
|
||||
for _, record in ipairs(res or {}) do
|
||||
if record.tstamp_epoch then
|
||||
record.tstamp = record.tstamp_epoch
|
||||
elseif record.tstamp then
|
||||
record.tstamp = format_utils.parseDateTime(record.tstamp)
|
||||
end
|
||||
|
||||
if record.tstamp_end_epoch then
|
||||
record.tstamp_end = record.tstamp_end_epoch
|
||||
elseif record.tstamp_end then
|
||||
record.tstamp_end = format_utils.parseDateTime(record.tstamp_end)
|
||||
end
|
||||
|
||||
-- first_seen is only used in where conditions as it is indexed,
|
||||
-- using tstamp in select as it is commong to all alert tables
|
||||
-- if record.first_seen then record.first_seen = format_utils.parseDateTime(record.first_seen) end
|
||||
|
||||
if record.user_label_tstamp then
|
||||
record.user_label_tstamp = format_utils.parseDateTime(record.user_label_tstamp)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- count records
|
||||
local count_res = 0
|
||||
if isEmptyString(group_by_clause) then
|
||||
|
|
|
|||
|
|
@ -2302,7 +2302,6 @@ local known_parameters = {
|
|||
["toggle_fingerprint_stats"] = validateBool,
|
||||
["toggle_starttls"] = validateBool,
|
||||
["toggle_dump_pcap_to_clickhouse"] = validateBool,
|
||||
["toggle_use_native_clickhouse_client"] = validateBool,
|
||||
["toggle_query_performance_log"] = validateBool,
|
||||
["behaviour_analysis_learning_period"] = validateNumber,
|
||||
["behaviour_analysis_learning_status_during_learning"] = validateNumber,
|
||||
|
|
|
|||
|
|
@ -234,10 +234,6 @@ local menu_subpages = {{
|
|||
title = i18n("prefs.toggle_dump_pcap_to_clickhouse_title"),
|
||||
description = i18n("prefs.toggle_dump_pcap_to_clickhouse_description")
|
||||
},
|
||||
toggle_use_native_clickhouse_client = {
|
||||
title = i18n("prefs.toggle_use_native_clickhouse_client_title"),
|
||||
description = i18n("prefs.toggle_use_native_clickhouse_client_description")
|
||||
},
|
||||
toggle_query_performance_log = {
|
||||
title = i18n("prefs.toggle_query_performance_log_title"),
|
||||
description = i18n("prefs.toggle_query_performance_log_description")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue