# Copyright (c) 2010 Flowerfire, Inc. All Rights Reserved. bind9_query_syslog = { plugin_version = "1.1" info.1.manufacturer = "Internet Systems Consortium" info.1.device = "BIND (Berkeley Internet Name Domain)" info.1.version.1 = "9.7.2-P3" # ??/??/???? ??:??:?? : 1.0 : ... : initial creation # 17/01/2011 10:08:35 : 1.0 : gas : added support for new line type # 2010-10-13 - 1.0.1 - MSG - Edited info lines. # 20/01/2011 12:33:22 : 1.1 : gas : split the query into fields # The name of the log format log.format.format_label = "Bind 9 Log Format (Syslog required)" 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_expression = ` matches_regular_expression(volatile.log_data_line, 'client [0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+#[0-9]+: query:') or matches_regular_expression(volatile.log_data_line, 'client [0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+#[0-9]+: [^:]*: query:') ` # This regular expression is used to parse the log fields out of the log entry #log_file_format_regular_expression # "^([A-Z][a-z][a-z] [ 0-9][0-9]) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9]) ([A-z]* [A-z]*\\[[0-9]*\\]): client ([0-9.]*)#[0-9]*: query: (.*)$" # All log field parsing will be done using the parsing filters log.format.parse_only_with_filters = "true" # A log entry is called a lookup statistics.miscellaneous.entry_name = "lookups" # Log fields log.fields = { client = { label = "$lang_stats.field_labels.client" type = "flat" index = 0 subindex = 0 } # client query = "" type = "" server_ip = "" } # log.fields # Log Parsing Filters log.parsing_filters = { # Parse out the query 10 = { label = "1" comment = "" value = "collect_fields_using_regexp('()client ([0-9.]+)#[0-9]+: query: (.*)$', '*KEY*,client,query')" } # 1 # Parse out the query new line type 15 = { label = "1" comment = "" value = "collect_fields_using_regexp('()client ([0-9.]+)#[0-9]+: [^:]*: query: (.*)$', '*KEY*,client,query')" } # 1 18 = { value = ` if (matches_regular_expression(get_collected_field('', 'query'), '^([^ ]+) [^ ]+ ([^ ]+) [^ ]+ \\(([^)]+)\\)')) then ( set_collected_field('', 'query', $1); set_collected_field('', 'type', $2); set_collected_field('', 'server_ip', $3); ); ` } # 18 # Accept a collected field 20 = { label = "2" comment = "" value = "accept_collected_entry_using_regexp('()', false)" } # 2 } # log.parsing_filters # Database fields database.fields = { client = { label = "$lang_stats.field_labels.client" log_field = "client" type = "string" suppress_top = 0 suppress_bottom = 2 } # client query = "" type = "" server_ip = "" } # 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 = 'lookups = 1;' } # mark_entry } # log.filters database.numerical_fields = { lookups = { label = "$lang_stats.field_labels.lookups" default = true requires_log_field = false type = "int" display_format_type = "integer" entries_field = true } # lookups unique_client_ips = { label = "$lang_stats.field_labels.unique_client_ips" default = false requires_log_field = true log_field = "client_ip" type = "unique" display_format_type = "integer" } # unique_client_ips } # 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 } # bind9_query_syslog