Skip to content

Commit

Permalink
display source in alerts list when an alert has multiple decisions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
blotus authored Mar 6, 2023
1 parent b2c2c5a commit e27a0a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/crowdsec-cli/alerts_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e27a0a0

Please sign in to comment.