diff --git a/internal/collector/iis/iis.go b/internal/collector/iis/iis.go index 9ef804706..31e126023 100644 --- a/internal/collector/iis/iis.go +++ b/internal/collector/iis/iis.go @@ -199,22 +199,22 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.iis.app-exclude", "Regexp of apps to exclude. App name must both match include and not match exclude to be included.", - ).Default(c.config.AppExclude.String()).StringVar(&appExclude) + ).Default("").StringVar(&appExclude) app.Flag( "collector.iis.app-include", "Regexp of apps to include. App name must both match include and not match exclude to be included.", - ).Default(c.config.AppInclude.String()).StringVar(&appInclude) + ).Default(".+").StringVar(&appInclude) app.Flag( "collector.iis.site-exclude", "Regexp of sites to exclude. Site name must both match include and not match exclude to be included.", - ).Default(c.config.SiteExclude.String()).StringVar(&siteExclude) + ).Default("").StringVar(&siteExclude) app.Flag( "collector.iis.site-include", "Regexp of sites to include. Site name must both match include and not match exclude to be included.", - ).Default(c.config.SiteInclude.String()).StringVar(&siteInclude) + ).Default(".+").StringVar(&siteInclude) app.Action(func(*kingpin.ParseContext) error { var err error diff --git a/internal/collector/logical_disk/logical_disk.go b/internal/collector/logical_disk/logical_disk.go index a2ad3f56d..dd2374c48 100644 --- a/internal/collector/logical_disk/logical_disk.go +++ b/internal/collector/logical_disk/logical_disk.go @@ -99,12 +99,12 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.logical_disk.volume-exclude", "Regexp of volumes to exclude. Volume name must both match include and not match exclude to be included.", - ).Default(c.config.VolumeExclude.String()).StringVar(&volumeExclude) + ).Default("").StringVar(&volumeExclude) app.Flag( "collector.logical_disk.volume-include", "Regexp of volumes to include. Volume name must both match include and not match exclude to be included.", - ).Default(c.config.VolumeInclude.String()).StringVar(&volumeInclude) + ).Default(".+").StringVar(&volumeInclude) app.Action(func(*kingpin.ParseContext) error { var err error diff --git a/internal/collector/net/net.go b/internal/collector/net/net.go index 01a025d7e..a3870187c 100644 --- a/internal/collector/net/net.go +++ b/internal/collector/net/net.go @@ -100,12 +100,12 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.net.nic-exclude", "Regexp of NIC:s to exclude. NIC name must both match include and not match exclude to be included.", - ).Default(c.config.NicExclude.String()).StringVar(&nicExclude) + ).Default("").StringVar(&nicExclude) app.Flag( "collector.net.nic-include", "Regexp of NIC:s to include. NIC name must both match include and not match exclude to be included.", - ).Default(c.config.NicInclude.String()).StringVar(&nicInclude) + ).Default(".+").StringVar(&nicInclude) app.Flag( "collector.net.enabled", diff --git a/internal/collector/physical_disk/physical_disk.go b/internal/collector/physical_disk/physical_disk.go index e251088f6..7ff8b6d47 100644 --- a/internal/collector/physical_disk/physical_disk.go +++ b/internal/collector/physical_disk/physical_disk.go @@ -76,12 +76,12 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.physical_disk.disk-exclude", "Regexp of disks to exclude. Disk number must both match include and not match exclude to be included.", - ).Default(c.config.DiskExclude.String()).StringVar(&diskExclude) + ).Default("").StringVar(&diskExclude) app.Flag( "collector.physical_disk.disk-include", "Regexp of disks to include. Disk number must both match include and not match exclude to be included.", - ).Default(c.config.DiskInclude.String()).StringVar(&diskInclude) + ).Default(".+").StringVar(&diskInclude) app.Action(func(*kingpin.ParseContext) error { var err error diff --git a/internal/collector/printer/printer.go b/internal/collector/printer/printer.go index 3691da838..1617c1430 100644 --- a/internal/collector/printer/printer.go +++ b/internal/collector/printer/printer.go @@ -77,12 +77,12 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.printer.include", "Regular expression to match printers to collect metrics for", - ).Default(c.config.PrinterInclude.String()).StringVar(&printerInclude) + ).Default(".+").StringVar(&printerInclude) app.Flag( "collector.printer.exclude", "Regular expression to match printers to exclude", - ).Default(c.config.PrinterExclude.String()).StringVar(&printerExclude) + ).Default("").StringVar(&printerExclude) app.Action(func(*kingpin.ParseContext) error { var err error diff --git a/internal/collector/process/process.go b/internal/collector/process/process.go index d5cc66186..3d1089399 100644 --- a/internal/collector/process/process.go +++ b/internal/collector/process/process.go @@ -92,12 +92,12 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.process.exclude", "Regexp of processes to exclude. Process name must both match include and not match exclude to be included.", - ).Default(c.config.ProcessExclude.String()).StringVar(&processExclude) + ).Default("").StringVar(&processExclude) app.Flag( "collector.process.include", "Regexp of processes to include. Process name must both match include and not match exclude to be included.", - ).Default(c.config.ProcessInclude.String()).StringVar(&processInclude) + ).Default(".+").StringVar(&processInclude) app.Flag( "collector.process.iis", diff --git a/internal/collector/scheduled_task/scheduled_task.go b/internal/collector/scheduled_task/scheduled_task.go index 6417ad186..810ebcfa0 100644 --- a/internal/collector/scheduled_task/scheduled_task.go +++ b/internal/collector/scheduled_task/scheduled_task.go @@ -106,12 +106,12 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.scheduled_task.exclude", "Regexp of tasks to exclude. Task path must both match include and not match exclude to be included.", - ).Default(c.config.TaskExclude.String()).StringVar(&taskExclude) + ).Default("").StringVar(&taskExclude) app.Flag( "collector.scheduled_task.include", "Regexp of tasks to include. Task path must both match include and not match exclude to be included.", - ).Default(c.config.TaskInclude.String()).StringVar(&taskInclude) + ).Default(".+").StringVar(&taskInclude) app.Action(func(*kingpin.ParseContext) error { var err error diff --git a/internal/collector/service/service.go b/internal/collector/service/service.go index 25252636b..c15cb6114 100644 --- a/internal/collector/service/service.go +++ b/internal/collector/service/service.go @@ -72,12 +72,12 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.service.exclude", "Regexp of service to exclude. Service name (not the display name!) must both match include and not match exclude to be included.", - ).Default(c.config.ServiceExclude.String()).StringVar(&serviceExclude) + ).Default("").StringVar(&serviceExclude) app.Flag( "collector.service.include", "Regexp of service to include. Process name (not the display name!) must both match include and not match exclude to be included.", - ).Default(c.config.ServiceInclude.String()).StringVar(&serviceInclude) + ).Default(".+").StringVar(&serviceInclude) app.Action(func(*kingpin.ParseContext) error { var err error diff --git a/internal/collector/smtp/smtp.go b/internal/collector/smtp/smtp.go index 4edfd1d0b..35977e09e 100644 --- a/internal/collector/smtp/smtp.go +++ b/internal/collector/smtp/smtp.go @@ -103,12 +103,12 @@ func NewWithFlags(app *kingpin.Application) *Collector { app.Flag( "collector.smtp.server-exclude", "Regexp of virtual servers to exclude. Server name must both match include and not match exclude to be included.", - ).Default(c.config.ServerExclude.String()).StringVar(&serverExclude) + ).Default("").StringVar(&serverExclude) app.Flag( "collector.smtp.server-include", "Regexp of virtual servers to include. Server name must both match include and not match exclude to be included.", - ).Default(c.config.ServerInclude.String()).StringVar(&serverInclude) + ).Default(".+").StringVar(&serverInclude) app.Action(func(*kingpin.ParseContext) error { var err error diff --git a/internal/types/regexp.go b/internal/types/regexp.go index c8826da5a..63e521821 100644 --- a/internal/types/regexp.go +++ b/internal/types/regexp.go @@ -3,6 +3,6 @@ package types import "regexp" var ( - RegExpAny = regexp.MustCompile("^(?:.+)$") - RegExpEmpty = regexp.MustCompile("^(?:)$") + RegExpAny = regexp.MustCompile("^.+$") + RegExpEmpty = regexp.MustCompile("^$") )