8000 Filter NAP logs by Severity by aphralG · Pull Request #1169 · nginx/agent · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge main
  • Loading branch information
aphralG committed Jul 22, 2025
commit 39df77f01a6dccd699d19b6de3734e5f30540630
32 changes: 16 additions & 16 deletions internal/collector/otel_collector_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,24 +554,24 @@ func (oc *Collector) updateNginxAppProtectTcplogReceivers(nginxConfigContext *mo
oc.config.Collector.Receivers.TcplogReceivers["nginx_app_protect"] = &config.TcplogReceiver{
ListenAddress: nginxConfigContext.NAPSysLogServer,
Operators: []config.Operator{
// regex captures the priority number from the log line
{
Type: "regex_parser",
Fields: map[string]string{
"regex": "^<(?P<priority>\\d+)>",
"parse_from": "body",
"parse_to": "attributes",
// regex captures the priority number from the log line
{
Type: "regex_parser",
Fields: map[string]string{
"regex": "^<(?P<priority>\\d+)>",
"parse_from": "body",
"parse_to": "attributes",
},
},
},
// filter drops all logs that have a severity above 4
// https://docs.secureauth.com/0902/en/how-to-read-a-syslog-message.html#severity-code-table
{
Type: "filter",
Fields: map[string]string{
"expr": "'int(attributes.priority) % 8 > 4'",
"drop_ratio": "1.0",
// filter drops all logs that have a severity above 4
// https://docs.secureauth.com/0902/en/how-to-read-a-syslog-message.html#severity-code-table
{
Type: "filter",
Fields: map[string]string{
"expr": "'int(attributes.priority) % 8 > 4'",
"drop_ratio": "1.0",
},
},
},
{
Type: "add",
Fields: map[string]string{
Expand Down
Loading
0