Enhance the logging rules so that filtering can be performed on log message content #144
Labels
area/ipcei
IPCEI (Important Project of Common European Interest)
kind/enhancement
Enhancement, improvement, extension
lifecycle/rotten
Denotes an issue or PR that has aged beyond stale and will be auto-closed.
priority/4
Priority (lower number equals higher priority)
How to categorize this issue?
/kind enhancement
What would you like to be added:
Add a field in the
rsyslogRelpConfig.loggingRules
that allows filtering based on message content. The filters should allow for both excluding or including messages based on their content via regular expressions. This could be done by addingregex
andexclude
fields which should be pointers to strings and marked as optional. Below is an example of what the new api would look like:To implement the regular expression, the following
RainerScript
functions could be used in the rsyslog config:re_match_i()
- case insensitive match orre_match()
- case sensitive match.This would result in the following rsyslog config:
This means that
messageContent
include
andexclude
directives areand
-ed when they are part of the sameloggingRule
. A subsequentloggingRule
could contain the sameprogramNames
and sameseverity
but differentmessageContent
fields resulting in anor
operation - this is becauseloggingRules[]
are checked in-order.Currently the
loggingRules[].severity
field is always required. However, we could change that and make at least one ofseverity
,programNames
ormessageContent
be required.Why is this needed:
Currently, the
shoot-rsyslog-relp
extension only allows for logs to be filtered based on the program name (that generated them) and their severity. However, this is not enough as sometimes users might want to further fine tune the filtering based on the message content of the logs.The text was updated successfully, but these errors were encountered: