瀏覽代碼

display source in alerts list when an alert has multiple decisions (#2098)

blotus 2 年之前
父節點
當前提交
e27a0a0e14
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      cmd/crowdsec-cli/alerts_table.go

+ 1 - 1
cmd/crowdsec-cli/alerts_table.go

@@ -24,7 +24,7 @@ func alertsTable(out io.Writer, alerts *models.GetAlertsResponse, printMachine b
 	for _, alertItem := range *alerts {
 		displayVal := *alertItem.Source.Scope
 		if len(alertItem.Decisions) > 1 {
-			displayVal = fmt.Sprintf("%d %ss", len(alertItem.Decisions), *alertItem.Decisions[0].Scope)
+			displayVal = fmt.Sprintf("%s (%d %ss)", *alertItem.Source.Scope, len(alertItem.Decisions), *alertItem.Decisions[0].Scope)
 		} else if *alertItem.Source.Value != "" {
 			displayVal += ":" + *alertItem.Source.Value
 		}