Skip to content

Commit

Permalink
extract and machine learning support
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Oct 26, 2023
1 parent 01322d2 commit 38f48b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions transformers/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func NewExtractSubprocessor(config *dnsutils.ConfigTransformers, logger *logger.
return s
}

func (p *ExtractProcessor) ReloadConfig(config *dnsutils.ConfigTransformers) {
p.config = config
}

func (p *ExtractProcessor) InitDnsMessage(dm *dnsutils.DnsMessage) {
if dm.Extracted == nil {
dm.Extracted = &dnsutils.TransformExtracted{
Expand Down
4 changes: 4 additions & 0 deletions transformers/machinelearning.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func NewMachineLearningSubprocessor(config *dnsutils.ConfigTransformers, logger
return s
}

func (p *MlProcessor) ReloadConfig(config *dnsutils.ConfigTransformers) {
p.config = config
}

func (p *MlProcessor) LogInfo(msg string, v ...interface{}) {
log := fmt.Sprintf("transformer=ml#%d - ", p.instance)
p.logInfo(log+msg, v...)
Expand Down
2 changes: 2 additions & 0 deletions transformers/subprocessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func (p *Transforms) ReloadConfig(config *dnsutils.ConfigTransformers) {
p.LatencyTransform.ReloadConfig(config)
p.SuspiciousTransform.ReloadConfig(config)
p.ReducerTransform.ReloadConfig(config)
p.ExtractProcessor.ReloadConfig(config)
p.MachineLearningTransform.ReloadConfig(config)

p.Prepare()
}
Expand Down

0 comments on commit 38f48b9

Please sign in to comment.