{= include "templates.shared.util.convert_integer_string_to_name"; include "templates.shared.util.get_licensing_features"; string autodetecting_id = volatile.autodetecting_id; # check features (lite | pro | enterprise) string licensing_features = get_licensing_features(); # ----------------- # detect log format # ----------------- debug_message("\n\n\n@@@@ detect_log_format.cfv START \n"); debug_message("log source:\n" . node_as_string("volatile.new_profile.log_source") . "\n"); # Autodetect the log format of the data at volatile.new_profile.log_source, # and put the result in volatile.autodetected_formats. # if the log_source type is "local" then convert the pathname from integer_string to name if (node_value("volatile.new_profile.log_source.0.type") eq "local") then ( string pathname = node_value("volatile.new_profile.log_source.0.pathname"); volatile.new_profile.log_source.0.pathname = convert_integer_string_to_name(pathname); ); # debug_message("\n\n@@@@ @@@@ autodetect_log_format START\n"); autodetect_log_format("volatile.new_profile.log_source", "volatile.autodetected_formats", autodetecting_id); # debug_message("\n\n@@@@ @@@@ autodetect_log_format END\n"); # If the log source was invalid, generate an error message. The text of the error message # is in volatile.error_message. #* if (node_exists("volatile.invalid_log_source")) then ( debug_message("\n\n\n#### volatile.invalid_log_source NODE EXISTS \n"); ) else ( debug_message("\n\n\n#### volatile.invalid_log_source NODE DOES NOT EXIST \n"); ); if (node_exists("internal.invalid_log_source")) then ( debug_message("\n\n\n#### internal.invalid_log_source NODE EXISTS \n"); ) else ( debug_message("\n\n\n#### internal.invalid_log_source NODE DOES NOT EXIST \n"); ); *# bool invalid_log_source = node_value("volatile.invalid_log_source"); debug_message("#### invalid_log_source: " . invalid_log_source . "\n"); if (!invalid_log_source) then ( # ---------------- # valid log source # ---------------- debug_message("\n\n\nAutodetected log formats:\n" . node_as_string("volatile.autodetected_formats") . "\n"); # Lite cleanup from Beta log formats if (licensing_features eq "lite" and node_exists("volatile.autodetected_formats") and (num_subnodes("volatile.autodetected_formats") > 0)) then ( # remove any Beta log format in Lite version node item; foreach item "volatile.autodetected_formats" ( if (starts_with(node_value(item), "beta_")) then ( delete_node(item); ); ); debug_message("\n\n\nAutodetected log formats in Lite after cleanup from BETA log formats:\n" . node_as_string("volatile.autodetected_formats") . "\n"); ); if (!node_exists("volatile.autodetected_formats") or (num_subnodes("volatile.autodetected_formats") == 0)) then ( volatile.autodetected_formats = false; ); # clone the node and save it in TemporaryFiles clone_node("volatile.autodetected_formats", "TemporaryFiles." . autodetecting_id); ) else ( # ------------------ # invalid log source # ------------------ # Note, we save the error message in TemporaryFiles in the same node # as we would have saved autodetected formats! string msg = "-"; if (node_exists("volatile.error_message")) then ( msg = volatile.error_message; ); "TemporaryFiles." . autodetecting_id . ".error_message" = msg; debug_message("#### log source error message:\n" . node_as_string("volatile.error_message") . "\n\n"); ); save_node("TemporaryFiles." . autodetecting_id); =}