parse the duration string specified in an event file config into a time.Duration (#1446)

This commit is contained in:
Jim authored and GitHub committed 2021-08-04 17:57:36 -04:00
1 parent 8496093874
commit acc3dda2df
3 files changed
+24 -7

No files matched your search

+6 -5
View File
@@ -75,11 +75,12 @@ type StderrSinkTypeConfig struct{}
// FileSinkTypeConfig contains configuration structures for file sink types
type FileSinkTypeConfig struct {
Path string `hcl:"path" mapstructure:"path"` // Path defines the file path for the sink
FileName string `hcl:"file_name" mapstructure:"file_name"` // FileName defines the file name for the sink
RotateBytes int `hcl:"rotate_bytes" mapstructure:"rotate_bytes"` // RotateByes defines the number of bytes that should trigger rotation of a FileSink
RotateDuration time.Duration `hcl:"rotate_duration" mapstructure:"rotate_duration"` // RotateDuration defines how often a FileSink should be rotated
RotateMaxFiles int `hcl:"rotate_max_files" mapstructure:"rotate_max_files"` // RotateMaxFiles defines how may historical rotated files should be kept for a FileSink
Path string `hcl:"path" mapstructure:"path"` // Path defines the file path for the sink
FileName string `hcl:"file_name" mapstructure:"file_name"` // FileName defines the file name for the sink
RotateBytes int `hcl:"rotate_bytes" mapstructure:"rotate_bytes"` // RotateBytes defines the number of bytes that should trigger rotation of a FileSink
RotateDuration time.Duration `mapstructure:"rotate_duration"` // RotateDuration defines how often a FileSink should be rotated
RotateDurationHCL string `hcl:"rotate_duration" json:"-"` // RotateDurationHCL defines hcl string version of RotateDuration
RotateMaxFiles int `hcl:"rotate_max_files" mapstructure:"rotate_max_files"` // RotateMaxFiles defines how may historical rotated files should be kept for a FileSink
}
// FilterType defines a type for filters (allow or deny)