# Copyright (c) 2010 Flowerfire, Inc. All Rights Reserved. mikrotik_web_proxy = { plugin_version = "1.1" # 2011-11-17 - 1.0 - KBB - Initial creation # Are there other possible fields from key/value pairs? See http://wiki.mikrotik.com/wiki/Manual:IP/Proxy. # 2012-05-14 - 1.1 - MSG - Changed 'syslog_required' to 'syslog_optional' info.1.manufacturer = "MikroTik" info.1.device = "Web Proxy" info.1.version.1 = "" # The name of the log format log.format.format_label = "Mikrotik Web Proxy Log Format" log.miscellaneous.log_data_type = "syslog_optional" log.miscellaneous.log_format_type = "network_device" # The log is in this format if any of the first ten lines match this regular expression #Oct 5 00:59:00 192.168.22.22 Lizard_Media 192.168.22.55 POST http://stream.lizard.com/hello/radio action=allow cache=MISS #Oct 5 01:00:50 192.168.22.22 Lizard_Media 192.168.22.55 POST http://www.snake.com/good-bye action=deny log.format.autodetect_regular_expression = "[^ ]+ [0-9.]+ [A-Z]+ [^ ]+ action=allow cache=" # Log fields log.fields = { router_name = "" client_ip = "" method = "" url.type = "page" action = "" cache = "" } # log.fields log.parsing_filters.parse = ` #Oct 5 00:59:00 192.168.22.22 Lizard_Media 192.168.22.55 POST http://stream.lizard.com/hello/radio action=allow cache=MISS #Oct 5 01:00:50 192.168.22.22 Lizard_Media 192.168.22.55 POST http://www.snake.com/good-bye action=deny if (matches_regular_expression(v.syslog_message, '([^ ]+) ([0-9.]+) ([^ ]+) ([^ ]+) (.*)$')) then ( set_collected_field('', 'router_name', $1); set_collected_field('', 'client_ip', $2); set_collected_field('', 'method', $3); set_collected_field('', 'url', $4); collect_listed_fields('', $5, ' ', '=', ''); accept_collected_entry('', false); ) ` # Database fields database.fields = { router_name = "" client_ip = "" method = "" url = "" file_type = "" action = "" cache = "" } # database.fields # Log Filters log.filters = { remove_query = { label = "$lang_admin.log_filters.remove_query_label" comment = "$lang_admin.log_filters.remove_query_comment" value = "if (contains(url, '?')) then url = substr(url, 0, index(url, '?') + 1) . '(parameters)';" } # remove_query detect_page_views = { label = '$lang_admin.log_filters.detect_page_views_label' comment = '$lang_admin.log_filters.detect_page_views_comment' value = "if ((file_type eq 'JPEG') or (file_type eq 'JPG') or (file_type eq 'GIF') or (file_type eq 'ICO') or (file_type eq 'PNG') or (file_type eq 'CSS') or (file_type eq 'SWF') or (file_type eq 'JS')) then page_views = 0; else page_views = 1;" } # detect_page_views simplify_url = { label = "$lang_admin.log_filters.simplify_url_label" comment = "$lang_admin.log_filters.simplify_url_comment" value = "if (matches_regular_expression(url, '^([^:]+://[^/]+/)')) then url = $1 . '(omitted)'" } # simplify_url strip_non_page_views = { label = '$lang_admin.log_filters.strip_non_page_views_label' comment = '$lang_admin.log_filters.strip_non_page_views_comment' value = "if (page_views == 0) then url = substr(url, 0, last_index(url, '/') + 1) . '(nonpage)';" } # strip_non_page_views 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 log.field_options = { sessions_page_field = "url" sessions_visitor_id_field = "client_ip" sessions_event_field = "page_views" } # log.field_options database.numerical_fields = { events = { default = true requires_log_field = false type = "int" display_format_type = "integer" entries_field = true } # events page_views = { label = "$lang_stats.field_labels.page_views" default = true requires_log_field = false type = "int" display_format_type = "integer" } # page_views 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 } # mikrotik_web_proxy