Cleanup code for json field lookup

This commit is contained in:
Alfredo Cardigliano 2022-06-17 09:56:50 +02:00
parent 3fc8a0a71d
commit 4413f41b65
5 changed files with 11 additions and 21 deletions

View file

@ -5355,23 +5355,6 @@ function format_external_link(url, name, no_html, proto)
return external_field
end
-- ##############################################
-- @brief This function format the info field used in tables
-- @params info: A string containing the info field
-- no_html: A boolean, true if no_html is requested (e.g. Download in CSV format),
-- false otherwise
-- @return A string containing the info field formatted
function format_query_json_value(alert_or_flow, nested_field)
local field_to_search = "ALERT_JSON"
if alert_or_flow == 'alert' then
field_to_search = "json"
end
return string.format('JSON_VALUE(%s, \'$.%s\')', field_to_search, nested_field)
end
-- ##############################################