Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/component/loki/source/windowsevent/arguments.go
5327 views
1
package windowsevent
2
3
import (
4
"time"
5
6
"github.com/grafana/agent/component/common/loki"
7
)
8
9
// Arguments holds values which are used to configure the loki.source.windowsevent
10
// component.
11
type Arguments struct {
12
Locale int `river:"locale,attr,optional"`
13
EventLogName string `river:"eventlog_name,attr,optional"`
14
XPathQuery string `river:"xpath_query,attr,optional"`
15
BookmarkPath string `river:"bookmark_path,attr,optional"`
16
PollInterval time.Duration `river:"poll_interval,attr,optional"`
17
ExcludeEventData bool `river:"exclude_event_data,attr,optional"`
18
ExcludeUserdata bool `river:"exclude_user_data,attr,optional"`
19
UseIncomingTimestamp bool `river:"use_incoming_timestamp,attr,optional"`
20
ForwardTo []loki.LogsReceiver `river:"forward_to,attr"`
21
}
22
23
func defaultArgs() Arguments {
24
return Arguments{
25
Locale: 0,
26
EventLogName: "",
27
XPathQuery: "*",
28
BookmarkPath: "",
29
PollInterval: 3 * time.Second,
30
ExcludeEventData: false,
31
ExcludeUserdata: false,
32
UseIncomingTimestamp: false,
33
}
34
}
35
36
// UnmarshalRiver implements river.Unmarshaler.
37
func (r *Arguments) UnmarshalRiver(f func(v interface{}) error) error {
38
*r = defaultArgs()
39
40
type arguments Arguments
41
if err := f((*arguments)(r)); err != nil {
42
return err
43
}
44
45
return nil
46
}
47
48