From 329e94b0380b79fef7e7978121dd8eb25d59e3b0 Mon Sep 17 00:00:00 2001 From: Eric Holt Date: Mon, 17 Aug 2020 17:08:55 -0400 Subject: [PATCH 1/2] Create Apache HTTP Server Plugin --- plugins/apache_http.yaml | 82 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 plugins/apache_http.yaml diff --git a/plugins/apache_http.yaml b/plugins/apache_http.yaml new file mode 100644 index 00000000..92b03955 --- /dev/null +++ b/plugins/apache_http.yaml @@ -0,0 +1,82 @@ +version: 0.0.1 +title: Apache HTTP Server +description: Log parser for Apache HTTP Server +parameters: + enable_error_log: + label: Error Logs + description: Enable to collect Apache HTTP Server error logs + type: bool + default: true + error_log_path: + label: Error Log Path + description: Path to error log file + type: string + default: "/var/log/apache2/error.log" + enable_access_log: + label: Access Logs + description: Enable to collect Apache HTTP Server access logs + type: bool + default: true + access_log_path: + label: Access Log Path + description: Path to access log file + type: string + default: "/var/log/apache2/access.log" + start_at: + label: Start At + description: Start reading file from 'beginning' or 'end' + type: enum + valid_values: + - beginning + - end + default: end + + # Set Defaults + #{{$enable_error_log := default true .enable_error_log}} + #{{$error_log_path := default "/var/log/apache2/error.log" .error_log_path}} + #{{$enable_access_log := default true .enable_access_log}} + #{{$access_log_path := default "/var/log/apache2/access.log" .access_log_path}} + #{{$start_at := default "end" .start_at}} +pipeline: + #{{ if $enable_error_log }} + - id: htaccess_access_reader + type: file_input + include: + - {{ $access_log_path }} + start_at: {{ $start_at }} + labels: + log_type: 'apache_http.access' + + - id: access_regex_parser + type: regex_parser + regex: '^(?P[^ ]*) (?P[^ ]*) (?P[^ ]*) \[(?P