beta_backup_exec = { # The name of the log format log.format.format_label = "Backup Exec Log Format (BETA)" log.miscellaneous.log_data_type = "other" log.miscellaneous.log_format_type = "application" # The log is in this format if any of the first ten lines match this regular expression log.format.autodetect_regular_expression = "^', less_than_index); # If the tag does not close on this line, that's an error if (greater_than_index == -1) then error("XML parsing error while reading log data"); # Get the tag name string tag_name = substr(v.line, less_than_index + 1, greater_than_index - less_than_index - 1); bool isSingleTag = ends_with(tag_name, '/'); # Discard attributes if (matches_regular_expression(tag_name, '^([^ ]*) ')) then ( tag_name = $1; if (isSingleTag) then tag_name .= '/'; ); # Continue reading the rest of the line v.line = substr(v.line, greater_than_index + 1); # Check for closing tag if (starts_with(tag_name, '/')) then ( # Get the tag name tag_name = substr(tag_name, 1); # echo("Closing tag: " . tag_name . "; value=" . current_value); # Verify that this is the open tag name if (!ends_with(xml_tag_stack, "//" . tag_name)) then error("XML parsing error while processing log data; closing tag '" . tag_name . "' is out of order; stack=" . xml_tag_stack); # Pop the closing tag off the stack xml_tag_stack = substr(xml_tag_stack, 0, length(xml_tag_stack) - length(tag_name) - 2); # echo("Now stack=" . xml_tag_stack); # Put this value in the log entry set_collected_field('', tag_name, current_value); # If this is the end of a "summary" tag, accept this entry if (tag_name eq "summary") then ( # Derive the duration int start_time_epoc; if (matches_regular_expression(get_collected_field('', 'start_time'), "^Backup started on ([0-9]+/[0-9]+/[0-9]+) at ([0-9:]+)\\\\.")) then ( start_time_epoc = date_time_to_epoc(normalize_date($1, 'dd/mm/yyyy') . ' ' . $2); set_collected_field('', 'date', normalize_date($1, 'dd/mm/yyyy')); set_collected_field('', 'time', $2); ); else if (matches_regular_expression(get_collected_field('', 'start_time'), "^Backup started on ([0-9]+/[0-9]+/[0-9]+) at ([0-9:]+ [AP]M)\\\\.")) then ( start_time_epoc = date_time_to_epoc(normalize_date($1, 'auto') . ' ' . $2); set_collected_field('', 'date', normalize_date($1, 'auto')); set_collected_field('', 'time', $2); ); if (matches_regular_expression(get_collected_field('', 'end_time'), "^Backup completed on ([0-9/]+) at ([0-9:]+)\\\\.")) then ( int end_time_epoc = date_time_to_epoc(normalize_date($1, 'dd/mm/yyyy') . ' ' . $2); set_collected_field('', 'duration', end_time_epoc - start_time_epoc); ); else if (matches_regular_expression(get_collected_field('', 'end_time'), "^Backup completed on ([0-9/]+) at ([0-9:]+ [AP]M)\\\\.")) then ( int end_time_epoc = date_time_to_epoc(normalize_date($1, 'auto') . ' ' . $2); set_collected_field('', 'duration', end_time_epoc - start_time_epoc); ); # Derive information from backed_up_exchange_mailbox if (matches_regular_expression(get_collected_field('', 'backed_up_exchange_mailbox'), '^Backed up ([0-9]+) mail message.s. in ([0-9]+) folder.s. in ([0-9]+) mailbox.es')) then ( set_collected_field('', 'mail_messages_backed_up', $1); set_collected_field('', 'folders_backed_up', $2); set_collected_field('', 'mailboxes_backed_up', $3); ); # Derive information from misc if (matches_regular_expression(get_collected_field('', 'misc'), '^Backed up ([0-9]+) files in ([0-9]+) directories')) then ( set_collected_field('', 'files_backed_up', $1); set_collected_field('', 'directories_backed_up', $2); ); # Derive information from new_processed_bytes if (matches_regular_expression(get_collected_field('', 'new_processed_bytes'), '^Processed ([0-9,]+) bytes')) then ( set_collected_field('', 'bytes_processed', replace_all($1, ',', '')); ); set_collected_field('', 'sets_backed_up', 1); # Accept the entry accept_collected_entry('', false); ); # tag # Reset the value for the next tag current_value = ""; ); # if closing tag else if (ends_with(tag_name, '/')) then ( # echo("Single tag: " . tag_name); ); # if single tag # On open tag, remember the tag in the tag stack else ( # echo("Opening tag: " . tag_name); xml_tag_stack .= "//" . tag_name; # echo("Now stack=" . xml_tag_stack); ); ); # if found a tag # echo("Now v.line=" . v.line); ); # while line length ); # if not header line ` # Database fields database.fields = { date_time = "" day_of_week = "" hour_of_day = "" set_resource_name = "" tape_name = "" display_volume = "" description = "" backup_type = "" } # database.fields database.numerical_fields = { sets_backed_up = { default = true } # sets_backed_up duration = { type = float display_format_type = duration_compact } # duration files_backed_up = "" directories_backed_up = "" mail_messages_backed_up = "" folders_backed_up = "" mailboxes_backed_up = "" bytes_processed = { type = "float" display_format_type = "bandwidth" } } # database.numerical_fields create_profile_wizard_options = { # How the reports should be grouped in the report menu report_groups = { date_time_group = "" } # report_groups } # create_profile_wizard_options } # beta_backup_exec