#
#
# show_log_formats.cfv
# This displays all log formats in a single list to check
# the log_data_type and log format labels
#
#
include "templates.util.log_format_util";
include "templates.new_profile_wizard.log_format_labels_util";
subroutine(show_log_formats, (
node all_formats = new_node();
node all_types = new_node();
node log_format;
string name;
string label;
string log_data_type;
string log_format_type;
node log_format_info_labels;
node info_label_item;
string info_label;
int number_info_labels;
int count = 0;
foreach log_format "log_formats" (
name = node_name(log_format);
# debug_message("#### name:\n" . name . "\n");
label = @(log_format . ".log.format.format_label");
log_data_type = @(log_format . ".log.miscellaneous.log_data_type");
log_format_type = "";
if (?(log_format . ".log.miscellaneous.log_format_type") and
@(log_format . ".log.miscellaneous.log_format_type") ne "") then (
log_format_type = @(log_format . ".log.miscellaneous.log_format_type");
)
else (
log_format_type = "-";
);
log_format_info_labels = get_log_format_labels_from_log_format_info(log_format);
# Track the log_data_type and log_format_type
all_types{log_data_type} = "";
all_types{log_format_type} = "";
# debug_message("#### log_format_info_labels:\n" . node_as_string(log_format_info_labels) . "\n\n\n");
@all_formats{name}{"label"} = label;
@all_formats{name}{"labels"} = "";
@all_formats{name}{"log_data_type"} = log_data_type;
@all_formats{name}{"log_format_type"} = log_format_type;
# Write the info_labels to labels
number_info_labels = num_subnodes(log_format_info_labels);
if (number_info_labels > 0) then (
count = 1;
foreach info_label_item log_format_info_labels (
info_label = @info_label_item;
if (count != number_info_labels) then (
# Add br tag
info_label .= '
';
);
@all_formats{name}{"labels"}{node_name(info_label_item)} = info_label;
count++;
);
)
else (
@all_formats{name}{"labels"}{0} = "(unknown)";
);
#
#
# Create the html
#
#
subroutine(add_header_row, (
'
This shows an overview of the log format plug-ins.
';
'The Info labels column shows the auto generated labels as displayed in the new profile wizard.