Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dpluger can not check keyword on es6 #392

Merged
merged 6 commits into from
Mar 15, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: add missing keyword check on source SID field
  • Loading branch information
rkspx committed Mar 15, 2022
commit c54bb01a186a086d66513d13d6322769337f38aa
13 changes: 10 additions & 3 deletions internal/pkg/dpluger/dpluger.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,13 @@ func collectPair(plugin Plugin, confFile, esFilter string, validate bool) (tsvRe
)

sidSource := strings.Replace(plugin.Fields.PluginSID, "es:", "", 1)
titleSource, err := checkKeyword(ctx, plugin.Index, strings.Replace(plugin.Fields.Title, "es:", "", 1))
sidSource, err = checkKeyword(ctx, plugin.Index, sidSource)
if err != nil {
return c, err
}

titleSource := strings.Replace(plugin.Fields.Title, "es:", "", 1)
titleSource, err = checkKeyword(ctx, plugin.Index, titleSource)
if err != nil {
return c, err
}
Expand Down Expand Up @@ -475,7 +481,7 @@ func collectPair(plugin Plugin, confFile, esFilter string, validate bool) (tsvRe

fmt.Printf("Collecting unique entries for field '%s' and '%s' on index '%s' ... ", titleSource, sidSource, plugin.Index)
if esFilter != "" {
fmt.Printf("Limiting collection with term '%s'\n", esFilter)
fmt.Printf("Limiting collection with term '%s' ", esFilter)
}

fmt.Println("OK")
Expand All @@ -490,7 +496,8 @@ func collectSID(plugin Plugin, confFile, esFilter string, validate bool) (tsvRef
err error
)

sidSource, err := checkKeyword(ctx, plugin.Index, strings.Replace(plugin.Fields.PluginSID, "collect:", "", 1))
sidSource := strings.Replace(plugin.Fields.PluginSID, "collect:", "", 1)
sidSource, err = checkKeyword(ctx, plugin.Index, sidSource)
if err != nil {
return c, err
}
Expand Down