-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from observIQ/redis
Added redis
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<pid>\d+):(?P<role>[A-Z]) (?P<timestamp>\d{2} [a-zA-z]* \d{2}:\d{2}:\d{2}.\d{3})(?P<redis_severity> (\*|#|-|\.) )(?P<message>.*)' | ||
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}} |