Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions collectors/forwarder/collector/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ func SyncCollectorConfig() error {

for key := range cnf.Integrations {
if _, exists := config.ProtoPorts[config.DataType(key)]; !exists {
integration := cnf.Integrations[key]
if integration.HTTP != nil || integration.HTTPS != nil {
continue
}
delete(cnf.Integrations, key)
modified = true
utils.Logger.Info("Removed obsolete integration from config: %s", key)
Expand Down Expand Up @@ -252,8 +256,6 @@ func IsPortBindable(port string, proto string) bool {
}
}



func ChangeFileIntegrationStatus(logTyp string, isEnabled bool) ([]string, error) {
cnf, err := schema.ReadCollectorConfig()
if err != nil {
Expand Down Expand Up @@ -319,11 +321,11 @@ func GetFileIntegrationPaths(logTyp string) ([]string, error) {
}

type HTTPIntegrationOptions struct {
Proto string // "http" or "https"
Port string
Path string // URL path, default "/logs"
Bind string // bind address, default "127.0.0.1"
Auth string // "" | "bearer" | "hmac"
Proto string // "http" or "https"
Port string
Path string // URL path, default "/logs"
Bind string // bind address, default "127.0.0.1"
Auth string // "" | "bearer" | "hmac"
SignatureHeader string // e.g. "X-Hub-Signature-256"
}

Expand Down Expand Up @@ -352,11 +354,11 @@ func EnableHTTPIntegration(logTyp string, opts HTTPIntegrationOptions) error {

integration := cfg.Integrations[logTyp]
httpPort := &schema.HTTPPort{
Enabled: true,
Port: opts.Port,
Path: opts.Path,
Bind: opts.Bind,
Auth: opts.Auth,
Enabled: true,
Port: opts.Port,
Path: opts.Path,
Bind: opts.Bind,
Auth: opts.Auth,
SignatureHeader: opts.SignatureHeader,
}

Expand Down
Loading