forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
38 lines (31 loc) · 1.29 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package windows // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/windows"
import (
"time"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper"
)
const operatorType = "windows_eventlog_input"
// NewConfig will return an event log config with default values.
func NewConfig() *Config {
return NewConfigWithID(operatorType)
}
// NewConfig will return an event log config with default values.
func NewConfigWithID(operatorID string) *Config {
return &Config{
InputConfig: helper.NewInputConfig(operatorID, operatorType),
MaxReads: 100,
StartAt: "end",
PollInterval: 1 * time.Second,
}
}
// Config is the configuration of a windows event log operator.
type Config struct {
helper.InputConfig `mapstructure:",squash"`
Channel string `mapstructure:"channel"`
MaxReads int `mapstructure:"max_reads,omitempty"`
StartAt string `mapstructure:"start_at,omitempty"`
PollInterval time.Duration `mapstructure:"poll_interval,omitempty"`
Raw bool `mapstructure:"raw,omitempty"`
ExcludeProviders []string `mapstructure:"exclude_providers,omitempty"`
}