Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
This commit is contained in:
Manuel Sabban 2022-09-14 15:26:26 +02:00 committed by GitHub
parent 9b3ff82542
commit 1f06f242cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path"
"strings"
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
@ -37,6 +38,9 @@ func Init(c map[string]interface{}) (*UnixParserCtx, error) {
}
r.DataFolder = c["data"].(string)
for _, f := range files {
if strings.Contains(f.Name(), ".") {
continue
}
if err := r.Grok.AddFromFile(path.Join(c["patterns"].(string), f.Name())); err != nil {
log.Errorf("failed to load pattern %s : %v", f.Name(), err)
return nil, err