Skip to content

Commit

Permalink
Merge pull request #31 from liuwenping/master
Browse files Browse the repository at this point in the history
minor: fix uniq filter index
  • Loading branch information
liuwenping authored Mar 7, 2022
2 parents f4c500a + caefd16 commit 8379c1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func NewTaskConfig(rawConfig *beat.Config) (*TaskConfig, error) {
sort.Sort(ConditionSortByIndex(f.Conditions))
// uniq filter index
lastIndex := 0
for _, condition := range f.Conditions {
if lastIndex == condition.Index {
for idx, condition := range f.Conditions {
if idx != 0 && lastIndex == condition.Index {
return nil, fmt.Errorf("filter has duplicate index")
}
lastIndex = condition.Index
Expand Down

0 comments on commit 8379c1f

Please sign in to comment.