mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
plugin/log: support multi nameScope (#2420)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user