# Copyright (c) 2010 Flowerfire, Inc. All Rights Reserved. merak_popimap = { version = "2.1" info.1.manufacturer = "Merak" info.1.device = "POP/IMAP Server" info.1.version.1 = "9" # 9.4 # ????-??-?? - ??? - 1.0 - Initial implementation # 2009-08-17 - GMF - 2.0 - Added support for new format. # 2010-01-14 - gas - 2.1 - Added support for new format. # The name of the log format log.format.format_label = "Merak POP/IMAP Log Format" log.miscellaneous.log_data_type = "mail_pop" log.miscellaneous.log_format_type = "mail_server" # The log is in this format if any of the first ten lines match this regular expression # 10.10.10.84 [0CDC] 00:00:02 Connected log.format.autodetect_regular_expression = "^[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+ *\\[[0-9A-F]+\\] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] Connected$" log.format.autodetect_lines = 30 # All log field parsing will be done using the parsing filters log.format.parse_only_with_filters = "true" # An entry in this log is called a "connection" in the statistics statistics.miscellaneous.entry_name = "connections" # Log fields log.fields = { date = "" time = "" user = "" source_ip.type = "host" } # log.fields log.parsing_filters.parse = ` # Get the IP if (matches_regular_expression(current_log_line(), '^([^ ]+) +\\\\[([0-9A-F]+)\\\\] (.*)$')) then ( # we should use the IP as the key, the odd string betwen the [] seems to vary wildly and gives bad bad numbers - gas # v.key = $2; v.key = $1; v.message = $3; set_collected_field(v.key, 'source_ip', $1); # Get the date from the message, if it's there if (matches_regular_expression(v.message, '^[A-Z][a-z][a-z], ([0-9 ][0-9] [A-Z][a-z][a-z] [0-9]+) ([0-9:]+) (.*)$')) then ( set_collected_field(v.key, 'date', $1); set_collected_field(v.key, 'time', $2); v.message = $3; ); # If it's just the time, use that, and then look for the date in the pathname; or default to today if that's not available either. if (matches_regular_expression(v.message, '^([0-9][0-9]:[0-9][0-9]:[0-9][0-9]) (.*)$')) then ( set_collected_field(v.key, 'time', $1); v.message = $2; if (matches_regular_expression(current_log_pathname(), 'm[A-Z]+([21][09][0-9]{2})([0-9]{2})([0-9]{2}).*[.]')) then set_collected_field(v.key, 'date', $1 . "/" . $2 . "/" . $3); else set_collected_field(v.key, 'date', substr(epoc_to_date_time(now()), 0, 11)); ); # if time only in log data # 10.10.10.84 [0CDC] 00:05:11 <<< aaab LOGIN postmaster@domain.com *********** if (matches_regular_expression(v.message, "^<<< ([^ ]+) LOGIN ([^ ]+)")) then ( set_collected_field(v.key, 'user', $2); ); # 10.10.10.84 [0CD8] 00:05:10 <<< USER postmaster@domain.com else if (matches_regular_expression(v.message, "^<<< USER (.*)$")) then ( set_collected_field(v.key, 'user', $1); ); else if (matches_regular_expression(v.message, "^Disconnected$")) then accept_collected_entry(v.key, false); ); ` # parsing filter # Database fields database.fields = { date_time = "" day_of_week = "" hour_of_day = "" user = "" source_ip = "" location = "" } # database.fields database.numerical_fields = { connections = { default = true requires_log_field = false entries_field = true } # connections } # database.numerical_fields log.filters = { mark_entry = { label = '$lang_admin.log_filters.mark_entry_label' comment = '$lang_admin.log_filters.mark_entry_comment' value = 'connections = 1;' } # mark_entry } # log.filters create_profile_wizard_options = { # How the reports should be grouped in the report menu report_groups = { date_time_group = "" user = true } # report_groups } # create_profile_wizard_options } # merak_popimap