# # # 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, ( ''; 'Log data type'; 'Log format type'; 'Label'; 'Info labels'; 'Name'; ''; )); subroutine(add_row( node item), ( ''; '' . @item{"log_data_type"} . ''; '' . @item{"log_format_type"} . ''; '' . @item{"label"} . ''; ''; if (num_subnodes(item{"labels"}) > 0) then ( node info_label; foreach info_label (item{"labels"}) ( @info_label; ); ) else ( ' '; ); ''; '' . node_name(item) . ''; ''; )); string general_table_rows; string syslog_required_table_rows; string syslog_optional_table_rows; string syslog_table_rows; node item; foreach item all_formats ( log_data_type = @item{"log_data_type"}; if (log_data_type eq "syslog_required") then ( syslog_required_table_rows .= add_row(item); ) else if (log_data_type eq "syslog_optional") then ( syslog_optional_table_rows .= add_row(item); ) else if (log_data_type eq "syslog") then ( syslog_table_rows .= add_row(item); ) else ( general_table_rows .= add_row(item); ); ); ); # debug_message("#### all_formats:\n" . node_as_string(all_formats) . "\n"); debug_message("#### all_types:\n" . node_as_string(all_types) . "\n\n\n"); '

Log Formats

'; '

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.

'; '

General log formats

'; ''; add_header_row(); general_table_rows; '
'; '

Syslog required

'; ''; add_header_row(); syslog_required_table_rows; '
'; '

Syslog optional

'; ''; add_header_row(); syslog_optional_table_rows; '
'; '

Syslog

'; ''; add_header_row(); syslog_table_rows; '
'; ));