victorialogs-datasource icon indicating copy to clipboard operation
victorialogs-datasource copied to clipboard

add support for configuring log level using custom rules

Open Loori-R opened this issue 11 months ago • 0 comments

Summary

This pull request adds a "Log level rules" section to the datasource configuration screen. It allows users to define custom rules for dynamically assigning log levels based on field values.

Related issue: #294, #209, #201

How it works

Click "Add rule" to create a new rule. Each rule consists of the following elements:

  1. Enable switch – toggle to enable or disable the rule.
  2. Field name – the log field the rule applies to.
  3. Operator – condition type: Equals, Not equal, Matches regex, Less than, Greater than.
  4. Value – the value to compare against.
  5. Log level – level to assign if the rule matches: critical, warning, error, info, debug, trace, unknown.
  6. Delete button – removes the rule.

After adding or editing rules, make sure to click "Save & test" to apply the updated configuration.

Rule priority

If multiple rules match, the first one in the list takes precedence.

image

Loori-R avatar May 20 '25 12:05 Loori-R