plugin/log: support multi nameScope (#2420)
This commit is contained in:
parent
53d1afbaf2
commit
418edd2a2f
3 changed files with 69 additions and 25 deletions
|
@ -55,6 +55,35 @@ func TestLogParse(t *testing.T) {
|
|||
Format: "{when}",
|
||||
Class: map[response.Class]struct{}{response.All: struct{}{}},
|
||||
}}},
|
||||
{`log example.org example.net`, false, []Rule{{
|
||||
NameScope: "example.org.",
|
||||
Format: DefaultLogFormat,
|
||||
Class: map[response.Class]struct{}{response.All: struct{}{}},
|
||||
}, {
|
||||
NameScope: "example.net.",
|
||||
Format: DefaultLogFormat,
|
||||
Class: map[response.Class]struct{}{response.All: struct{}{}},
|
||||
}}},
|
||||
{`log example.org example.net {host}`, false, []Rule{{
|
||||
NameScope: "example.org.",
|
||||
Format: "{host}",
|
||||
Class: map[response.Class]struct{}{response.All: struct{}{}},
|
||||
}, {
|
||||
NameScope: "example.net.",
|
||||
Format: "{host}",
|
||||
Class: map[response.Class]struct{}{response.All: struct{}{}},
|
||||
}}},
|
||||
{`log example.org example.net {when} {
|
||||
class denial
|
||||
}`, false, []Rule{{
|
||||
NameScope: "example.org.",
|
||||
Format: "{when}",
|
||||
Class: map[response.Class]struct{}{response.Denial: struct{}{}},
|
||||
}, {
|
||||
NameScope: "example.net.",
|
||||
Format: "{when}",
|
||||
Class: map[response.Class]struct{}{response.Denial: struct{}{}},
|
||||
}}},
|
||||
|
||||
{`log example.org {
|
||||
class all
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue