Forked from jgould22/gist:f42ad756fc07143e2a104d7844f39b12
Created
February 20, 2024 10:54
-
-
Save Saya47/5b50bc3df7c981f07a936bddfd5b3c54 to your computer and use it in GitHub Desktop.
Redis 7 Fluent-Bit Log parsing regex
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
# This is a partial regex to split a redis log line | |
# It will parse | |
# Pid | |
# The role (X, C, S, or M - https://github.com/redis/redis/blob/unstable/src/server.c#L130) | |
# Time | |
# level (.,-,*,# which are LOG_DEBUG, LOG_INFO, LOG_NOTICE, LOG_WARNING respectively - https://github.com/redis/redis/blob/unstable/src/server.c#L104) | |
# Message | |
[PARSER] | |
Name redis | |
Format regex | |
Regex ^(?<pid>[\d]):(?<role>[\w])\s(?<time>[^ ]*\s*[^ ]* [^ ]*\s[^ ]*)\s(?<level>[^ ]*)\s(?<message>.*$) | |
Time_Key time | |
Time_Format %d %b %Y %H:%M:%S.%L | |
Types pid:integer role:string message:string level:string | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment