Skip to content

Instantly share code, notes, and snippets.

@jgould22
Last active March 6, 2024 13:43
Show Gist options
  • Save jgould22/f42ad756fc07143e2a104d7844f39b12 to your computer and use it in GitHub Desktop.
Save jgould22/f42ad756fc07143e2a104d7844f39b12 to your computer and use it in GitHub Desktop.
Redis 7 Fluent-Bit Log parsing regex
# 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