# Copyright (c) 2012 Flowerfire, Inc. All Rights Reserved. apache_error_syslog_required = { plugin_version = "1.5" info.1.manufacturer = "Apache" info.1.device = "Error (syslog required)" info.1.version.1 = "" # 2008-07-14 - 1.0 - KBB - Initial creation, from apache_error.cfg. (I didn't make # apache_error.cfg a syslog_required plug-in since logging Apache with syslog is not common.) # 2010-10-11 - 1.0.1 - MSG - Edited info lines. # 2010-10-08 - 1.5 - Benson - fixed not match the Apache error log format from syslog-ng # The name of the log format log.format.format_label = "Apache Error Log Format (syslog required)" log.miscellaneous.log_data_type = "syslog_required" log.miscellaneous.log_format_type = "web_server" # By Windows Syslog #2010-10-05 09:00:05 Local0.Error 172.30.200.66 httpd[718]: [error] [client 172.30.200.232] File does not exist: /home/webadm/tyhp/a08/a0802/a080202/a08020201/alt-topbg.jpg, referer: http://www.typc.doh.gov.tw/main_sec.php?pid=42&index=public_se&bsid=doctor&sid=01 # By Linux syslog-ng #2010-09-16 15:00:12 local0.err 172.30.200.66 Sep 16 15:00:12 172.30.200.66 httpd[9882]: [error] [client 172.30.200.232] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/webadm/tyhp/sql_layer.php on line 428 # 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, "\\[[A-Z][a-z][a-z] [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][0-9][0-9]\\] \\[[a-z]*\\] \\[client [^]]*\\] ") or matches_regular_expression(volatile.log_data_line, "[^[]+\\[[0-9]+\\]: \\[[a-z]*\\] \\[client [^]]*\\] ") ` # All log field parsing will be done using the parsing filters log.format.parse_only_with_filters = "true" # Log fields log.fields = { date_time = "" type = "" error_type = "" hostname.type = "host" error_message = "" } # log.fields # Log Parsing Filters log.parsing_filters.parse = ` #[Jun Jun 01 01:01:01 2009] [http] [client 192.168.1.1] message if (matches_regular_expression(v.syslog_message, '^\\\\[[A-Z][a-z][a-z] ([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][0-9][0-9])\\\\] \\\\[([a-z]*)\\\\] \\\\[client ([^]]*)\\\\] (.*)$')) then ( set_collected_field('', 'date_time', $1); set_collected_field('', 'type', $2); set_collected_field('', 'hostname', $3); set_collected_field('', 'error_message', $4); accept_collected_entry('', false); ); # httpd[317]: [error] [client 172.30.200.232] File does not exist: /home/web/favicon.ico else if (matches_regular_expression(v.syslog_message, '^[a-z]*\\\\[[0-9]*\\\\]: \\\\[([a-z]*)\\\\] \\\\[client ([^]]*)\\\\] ([^:]*): (.*)$')) then ( set_collected_field('', 'type', $1); set_collected_field('', 'hostname', $2); set_collected_field('', 'error_type', $3); set_collected_field('', 'error_message', $4); accept_collected_entry('', false); ); # httpd[21674]: [error] error page is unavailable.\n else if (matches_regular_expression(v.syslog_message, '^[a-z]*\\\\[[0-9]*\\\\]: \\\\[([a-z]*)\\\\] (.*)$')) then ( set_collected_field('', 'type', $1); set_collected_field('', 'error_message', $2); accept_collected_entry('', false); ); ` # Database fields database.fields = { date_time = "" day_of_week = "" hour_of_day = "" type = "" hostname = "" error_type = "" domain_description = "" location = "" error_message = "" } # database.fields database.numerical_fields = { hits = { default = true requires_log_field = false entries_field = true } # hits } # database.numerical_fields log.filters = { mark_entry = { label = '$lang_admin.log_filters.mark_entry_label' comment = '$lang_admin.log_filters.mark_entry_comment' value = 'hits = 1;' } # mark_entry } # log.filters create_profile_wizard_options = { # How the reports should be grouped in the report menu report_groups = { date_time_group = "" day_of_week = true hour_of_day = true type = true hostname = true domain_description = true location = true error_message = true } # report_groups } # create_profile_wizard_options } # apache_error_syslog_required