Skip to content

Commit

Permalink
have pfdns set its processname through the config
Browse files Browse the repository at this point in the history
Seems the rsyslog filter on the programname contains isn't working so this worksaround it.

In reference to #3638 (comment)
  • Loading branch information
julsemaan committed Nov 9, 2018
1 parent 9a5f990 commit 0fed0b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions go/coredns/plugin/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ func setup(c *caddy.Controller) error {
fmt.Println("Using configuration set log level: " + level)
ctx = log.LoggerSetLevel(ctx, level)
}
case "processname":
args := c.RemainingArgs()

if len(args) != 1 {
return c.ArgErr()
} else {
name := args[0]
fmt.Println("Using configuration set processname: " + name)
log.SetProcessName(name)
}
default:
return c.ArgErr()
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pf/constants/syslog.pm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ our @SyslogInfo = (
},
{
'name' => 'pfdns.log',
'conditions' => [ '$programname contains "pfdns"' ]
'conditions' => [ '$programname == "pfdns"' ]
},
{
'name' => 'pffilter.log',
Expand Down

0 comments on commit 0fed0b8

Please sign in to comment.