# Copyright (c) 2010 Flowerfire, Inc. All Rights Reserved. cisco_3750 = { plugin_version = "1.1" # Initial creation - 1.0 # 2010-10-18 - 1.0.1 - MSG - Edited info lines. # 2016-06-08 - 1.1 - gas - added support for the message and state fields # fixed the interface field collection (copied code from cisco_pix plug-in which does this correctly) info.1.manufacturer = "Cisco Systems" info.1.device = "3750 Switch" info.1.version.1 = "" info.2.manufacturer = "Cisco Systems" info.2.device = "2960 Switch" info.3.manufacturer = "Cisco Systems" info.3.device = "4500 Switch" # The name of the log format log.format.format_label = "Cisco 3750 Log Format" log.miscellaneous.log_data_type = "syslog_required" log.miscellaneous.log_format_type = "network_device" # The log is in this format if any of the first ten lines match this regular expression log.format.autodetect_regular_expression = "[0-9]+: [A-Z][a-z][a-z] ?[0-9]+ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9]: %" # All log field parsing will be done using the parsing filters log.format.parse_only_with_filters = "true" # Log fields log.fields = { message_code = { label = "$lang_stats.field_labels.message_code" type = "flat" } # message_code host = { label = "$lang_stats.field_labels.host" type = "flat" } # host operation = { label = "$lang_stats.field_labels.operation" type = "flat" } # operation interface = { label = "$lang_stats.field_labels.interface" type = "flat" } # interface message = "" state = "" } # log.fields # # Log Parsing Filters log.parsing_filters = { # Parse out the message code parse = { label = "parse" comment = "" value = " if (matches_regular_expression(current_log_line(), '%([^:]+): (.*)$')) then ( set_collected_field('', 'message_code', $1); v.message = $2; set_collected_field('', 'message', v.message); if (matches_regular_expression(v.message, '^Host ([^ ]+) ([^ ]+) on interface (.*)$')) then ( set_collected_field('', 'host', $1); set_collected_field('', 'operation', $2); set_collected_field('', 'interface', $3); ); else if (matches_regular_expression(v.message, '^Interface ([^,]+), (changed state) to (.*)')) then ( set_collected_field('', 'interface', $1); set_collected_field('', 'operation', $2); set_collected_field('', 'state', $3); ); accept_collected_entry('', false); ); " } # parse } # log.parsing_filters # Database fields database.fields = { message_code = { label = "$lang_stats.field_labels.message_code" log_field = "message_code" type = "string" suppress_top = 0 suppress_bottom = 2 } # message_code host = { label = "$lang_stats.field_labels.host" log_field = "host" type = "string" suppress_top = 0 suppress_bottom = 2 } # host operation = { label = "$lang_stats.field_labels.operation" log_field = "operation" type = "string" suppress_top = 0 suppress_bottom = 2 } # operation interface = { label = "$lang_stats.field_labels.interface" log_field = "interface" type = "string" suppress_top = 0 suppress_bottom = 2 } # interface message = "" state = "" } # database.fields # Log Filters log.filters = { mark_entry = { label = '$lang_admin.log_filters.mark_entry_label' comment = '$lang_admin.log_filters.mark_entry_comment' value = 'events = 1;' } # mark_entry } # log.filters database.numerical_fields = { events = { label = "$lang_stats.field_labels.events" default = true requires_log_field = false type = "int" display_format_type = "integer" entries_field = true } # events } # 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 } # cisco_3750