From 1030a6b4ffda70b283fadc98b91881f65928016c Mon Sep 17 00:00:00 2001 From: Joshua Williams Date: Mon, 10 Aug 2020 15:24:07 -0400 Subject: [PATCH] Added redis --- plugins/redis.yaml | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 plugins/redis.yaml diff --git a/plugins/redis.yaml b/plugins/redis.yaml new file mode 100644 index 00000000..c7c10a86 --- /dev/null +++ b/plugins/redis.yaml @@ -0,0 +1,51 @@ +# Plugin Info +version: 0.0.1 +title: Redis +description: Log parser for Redis +parameters: + file_path: + label: Redis Logs Path + description: The absolute path to the Redis logs + type: string + default: "/var/log/redis/redis.log*" + start_at: + label: Start At + description: Start reading file from 'beginning' or 'end' + type: enum + valid_values: + - beginning + - end + default: end + +# Set Defaults +{{$file_path := default "/var/log/redis/redis.log*" .file_path}} +{{$start_at := default "end" .start_at}} + +# Pipeline Template +pipeline: + - id: redis_input + type: file_input + include: + - {{ $file_path }} + multiline: + line_start_pattern: \d+:[A-Z] \d{2} [a-zA-z]* \d{2}:\d{2}:\d{2}.\d{3} + start_at: {{ $start_at }} + labels: + log_type: redis + output: redis_parser + + - id: redis_parser + type: regex_parser + regex: '^(?P\d+):(?P[A-Z]) (?P\d{2} [a-zA-z]* \d{2}:\d{2}:\d{2}.\d{3})(?P (\*|#|-|\.) )(?P.*)' + timestamp: + parse_from: timestamp + layout: '%d %b %H:%M:%S.%s' + severity: + parse_from: redis_severity + preserve: true + mapping: + warning: ' # ' + info: ' - ' + debug: ' . ' + notice: ' * ' + output: {{.output}}