# Copyright (c) 2010 Flowerfire, Inc. All Rights Reserved.
backup_exec = {
plugin_version = "1.0.5"
info.1.manufacturer = "Symantec"
info.1.device = "Backup Exec"
info.1.version.1 = ""
info.2.manufacturer = "Veritas"
info.2.device = "Backup Exec"
info.2.version.1 = ""
# 2006-08-7 - 1.0.1beta - added server and name fields from header - KBB
# 2006-08-9 - 1.0.2beta - added handling for multi-line tags and CDATAs - KBB
# 2006-08-28 - 1.0.3beta - now skipping file and directory section between
# and tag pairs - huge directories are all on one line and very slow - KBB
# 2006-10-18 - 1.0.4beta - handle case where and are on same line - KBB
# 2007-09-11 - 1.0.4 - KBB - renumbered per new beta policy and changed
# file name from beta_backup_exec.cfg
# 2010-10-12 - 1.0.5 - MSG - Edited info lines.
# The name of the log format
log.format.format_label = "Backup Exec Log Format"
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 = "^ is found,
# we want to reset begin_ptr and continue - can
# be at the end of a very long line
if (isFileSection) then (
#echo("isFileSection - checking for end_time tag"); # debug
int et_ptr = index(v.line, '') == -1)) then (
# For now, skip attributes of multi-line tag, or CDATA contents
);
else (
# Finish with a multi line tag
if (isMultiLineTag) then (
#int greater_than_index = index(v.line, '>');
int greater_than_index = index(v.line, '>');
# Pop the tag off the stack if it turns out to be single
if (ends_with(substr(v.line, 0, greater_than_index), '/')) then (
xml_tag_stack = substr(xml_tag_stack, 0, length(xml_tag_stack) - length(multi_line_tag_name) - 2);
);
isMultiLineTag = false;
multi_line_tag_name = "";
#v.line = substr(v.line, greater_than_index + 1); # Continue reading the rest of the line
# Continue reading the rest of the line
begin_ptr = greater_than_index + 1;
);
while (begin_ptr < line_length) (
# Find the first tag in this line
int less_than_index = index(v.line, '<', begin_ptr);
#echo("Setting less_than_index " . less_than_index); # debug
# If there are no tags in this line, the whole line is part of the current value
if (less_than_index == -1) then (
current_value .= substr(v.line, begin_ptr) . "\n";
begin_ptr = line_length;
#echo("No tags - set begin_ptr " . begin_ptr); # debug
#echo("current_value *" . current_value . "*"); # debug
);
# Found a tag
else (
#echo("Found a tag v.line=*" . substr(v.line, begin_ptr) . "*"); # debug
string tag_name = "";
# Everything up to the tag is part of the current value
current_value .= substr(v.line, begin_ptr, less_than_index - begin_ptr);
#echo("Setting current_value " . current_value); # debug
# Find the close of the tag
int greater_than_index = index(v.line, '>', less_than_index);
#echo("Setting greater_than_index " . greater_than_index); # debug
# Get the tag name - Multi-line tag
if (greater_than_index == -1) then (
# Since we aren't processing attributes, the beginning is all that we
# need to process the tag
tag_name = substr(v.line, less_than_index + 1);
isMultiLineTag = true;
#v.line = "";
begin_ptr = line_length; # skip rest of line
#echo("Multi-line tag - set begin_ptr " . begin_ptr); # debug
);
# Regular tag
else (
tag_name = substr(v.line, less_than_index + 1, greater_than_index - less_than_index - 1);
#echo("Set tag_name " . tag_name); # debug
# Continue reading the rest of the line
#v.line = substr(v.line, greater_than_index + 1);
begin_ptr = greater_than_index + 1;
#echo("Regular tag - set begin_ptr " . begin_ptr); # debug
);
# It's a single tag, a CDATA or an xml special tag - don't put it on the stack
# Get this info before possibly chopping off '/' below
bool isSingleTag = (ends_with(tag_name, '/') or
starts_with(tag_name, '!') or # e.g.:
starts_with(tag_name, '?')); # e.g.:
# For now, discard attributes
if (matches_regular_expression(tag_name, '^([^ ]*) ')) then (
tag_name = $1;
#echo("After removing attributes from tag_name *" . tag_name . "*"); # debug
);
# Save (after mods) in case it is single and needs to be
# popped from the stack - doesn't hurt to save if not multi-line
multi_line_tag_name = tag_name;
# 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); # debug
# 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("Pop - now stack=" . xml_tag_stack); # debug
# Put this value in the log entry
set_collected_field('', tag_name, current_value);
# "start_time" is before file/directory section - need to check value because there is an
# earlier "start_time" for the whole log instead of the activity summarized in "summary"
if ((tag_name eq "start_time") and (starts_with(current_value, "Backup started"))) then (
###echo("isFileSection - found ending start_time tag - setting to true"); # debug
##isFileSection = true;
##begin_ptr = line_length;
#echo("found start_time tag"); # debug
int et_ptr = index(v.line, ' tag
# Reset the value for the next tag
current_value = "";
); # if closing tag
# It's a single tag, a CDATA or an xml special tag - don't put it on the stack
else if (isSingleTag) then (
#echo("Single tag: " . tag_name); # debug
); # if single tag
# On open tag, remember the tag in the tag stack
else (
#echo("Opening tag: *" . tag_name . "*"); # debug
xml_tag_stack .= "//" . tag_name;
#echo("Push - now stack=" . xml_tag_stack); # debug
);
); # if found a tag
#echo("Now v.line=" . substr(v.line, begin_ptr, 100)); # debug
#echo("Now v.line=" . substr(v.line, begin_ptr)); # debug
); # while line length
); # if not in the middle of a multi-line tag
`
# Database fields
database.fields = {
date_time = ""
day_of_week = ""
hour_of_day = ""
set_resource_name = ""
tape_name = ""
display_volume = ""
description = ""
backup_type = ""
server = ""
name = ""
} # 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
} # backup_exec