浏览代码

support yml file (#1605)

AlteredCoder 3 年之前
父节点
当前提交
a4f4eabf0a
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      pkg/leakybucket/manager_load.go
  2. 1 1
      pkg/parser/stage.go

+ 1 - 1
pkg/leakybucket/manager_load.go

@@ -153,7 +153,7 @@ func LoadBuckets(cscfg *csconfig.CrowdsecServiceCfg, files []string, tomb *tomb.
 	response = make(chan types.Event, 1)
 	response = make(chan types.Event, 1)
 	for _, f := range files {
 	for _, f := range files {
 		log.Debugf("Loading '%s'", f)
 		log.Debugf("Loading '%s'", f)
-		if !strings.HasSuffix(f, ".yaml") {
+		if !strings.HasSuffix(f, ".yaml") && !strings.HasSuffix(f, ".yml") {
 			log.Debugf("Skipping %s : not a yaml file", f)
 			log.Debugf("Skipping %s : not a yaml file", f)
 			continue
 			continue
 		}
 		}

+ 1 - 1
pkg/parser/stage.go

@@ -43,7 +43,7 @@ func LoadStages(stageFiles []Stagefile, pctx *UnixParserCtx, ectx EnricherCtx) (
 	pctx.Stages = []string{}
 	pctx.Stages = []string{}
 
 
 	for _, stageFile := range stageFiles {
 	for _, stageFile := range stageFiles {
-		if !strings.HasSuffix(stageFile.Filename, ".yaml") {
+		if !strings.HasSuffix(stageFile.Filename, ".yaml") && !strings.HasSuffix(stageFile.Filename, ".yml") {
 			log.Warningf("skip non yaml : %s", stageFile.Filename)
 			log.Warningf("skip non yaml : %s", stageFile.Filename)
 			continue
 			continue
 		}
 		}