Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Saya47/5b50bc3df7c981f07a936bddfd5b3c54 to your computer and use it in GitHub Desktop.
Save Saya47/5b50bc3df7c981f07a936bddfd5b3c54 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