Skip to content

Commit

Permalink
fix duplicated log messages and some format of log prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Issif <issif_github@gadz.org>
  • Loading branch information
Issif authored and poiana committed Apr 13, 2021
1 parent d0fd27b commit 31e9017
Show file tree
Hide file tree
Showing 18 changed files with 4 additions and 18 deletions.
1 change: 0 additions & 1 deletion outputs/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,4 @@ func (c *Client) AlertmanagerPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:alertmanager", "status:ok"})
c.Stats.Alertmanager.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "alertmanager", "status": OK}).Inc()
log.Printf("[INFO] : AlertManager - Publish OK\n")
}
2 changes: 1 addition & 1 deletion outputs/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *Client) EventHubPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:azureeventhub", "status:ok"})
c.Stats.AzureEventHub.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "azureeventhub", "status": OK}).Inc()
log.Printf("[INFO] : %v EventHub - Publish OK", c.OutputType)
log.Printf("[INFO] : %v EventHub - Publish OK", c.OutputType)
}

// setEventHubErrorMetrics set the error stats
Expand Down
2 changes: 1 addition & 1 deletion outputs/cloudevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ func (c *Client) CloudEventsSend(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:cloudevents", "status:ok"})
c.Stats.CloudEvents.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "cloudevents", "status": OK}).Inc()
log.Printf("[INFO] : CloudEvents - Send OK\n")
log.Printf("[INFO] : CloudEvents - Send OK\n")
}
1 change: 0 additions & 1 deletion outputs/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,4 @@ func (c *Client) DatadogPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:datadog", "status:ok"})
c.Stats.Datadog.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "datadog", "status": OK}).Inc()
log.Printf("[INFO] : Datadog - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,4 @@ func (c *Client) DiscordPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:discord", "status:ok"})
c.Stats.Discord.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "discord", "status": OK}).Inc()
log.Printf("[INFO] : Discord - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func (c *Client) ElasticsearchPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:elasticsearch", "status:ok"})
c.Stats.Elasticsearch.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "elasticsearch", "status": OK}).Inc()
log.Printf("[INFO] : ElasticSearch - Publish OK\n")
}

// setElasticSearchErrorMetrics set the error stats
Expand Down
1 change: 0 additions & 1 deletion outputs/googlechat.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,4 @@ func (c *Client) GooglechatPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:googlechat", "status:ok"})
c.Stats.GoogleChat.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "googlechat", "status": OK}).Inc()
log.Printf("[INFO] : GoogleChat - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ func (c *Client) InfluxdbPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:influxdb", "status:ok"})
c.Stats.Influxdb.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "influxdb", "status": OK}).Inc()
log.Printf("[INFO] : InfluxDB - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ func (c *Client) LokiPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:loki", "status:ok"})
c.Stats.Loki.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "loki", "status": OK}).Inc()
log.Printf("[INFO] : Loki - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,4 @@ func (c *Client) MattermostPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:mattermost", "status:ok"})
c.Stats.Mattermost.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "mattermost", "status": OK}).Inc()
log.Printf("[INFO] : Mattermost - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/opsgenie.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,4 @@ func (c *Client) OpsgeniePost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:opsgenie", "status:ok"})
c.Stats.Opsgenie.Add("ok", 1)
c.PromStats.Outputs.With(map[string]string{"destination": "opsgenie", "status": OK}).Inc()
log.Printf("[INFO] : OpsGenie - Publish OK\n")
}
2 changes: 1 addition & 1 deletion outputs/pagerduty.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c *Client) PagerdutyPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:pagerduty", "status:ok"})
c.Stats.Pagerduty.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "pagerduty", "status": OK}).Inc()
log.Printf("[INFO] : Pagerduty - Create Incident OK\n")
log.Printf("[INFO] : Pagerduty - Create Incident OK\n")
}

func createPagerdutyEvent(falcopayload types.FalcoPayload, config types.PagerdutyConfig) pagerduty.V2Event {
Expand Down
1 change: 0 additions & 1 deletion outputs/rocketchat.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,4 @@ func (c *Client) RocketchatPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:rocketchat", "status:ok"})
c.Stats.Rocketchat.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "rocketchat", "status": OK}).Inc()
log.Printf("[INFO] : RocketChat - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,4 @@ func (c *Client) SlackPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:slack", "status:ok"})
c.Stats.Slack.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "slack", "status": OK}).Inc()
log.Printf("[INFO] : Slack - Publish OK\n")
}
2 changes: 1 addition & 1 deletion outputs/stan.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (c *Client) StanPublish(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:stan", "status:ok"})
c.Stats.Stan.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "stan", "status": OK}).Inc()
log.Printf("[INFO] : STAN - Publish OK\n")
log.Printf("[INFO] : STAN - Publish OK\n")
}

// setStanErrorMetrics set the error stats
Expand Down
1 change: 0 additions & 1 deletion outputs/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,4 @@ func (c *Client) TeamsPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:teams", "status:ok"})
c.Stats.Teams.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "teams", "status": OK}).Inc()
log.Printf("[INFO] : Teams - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ func (c *Client) WebhookPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:webhook", "status:ok"})
c.Stats.Webhook.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "webhook", "status": OK}).Inc()
log.Printf("[INFO] : WebHook - Publish OK\n")
}
1 change: 0 additions & 1 deletion outputs/webui.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ func (c *Client) WebUIPost(falcopayload types.FalcoPayload) {
go c.CountMetric(Outputs, 1, []string{"output:webui", "status:ok"})
c.Stats.WebUI.Add(OK, 1)
c.PromStats.Outputs.With(map[string]string{"destination": "webui", "status": OK}).Inc()
log.Printf("[INFO] : WebUI - Publish OK\n")
}

0 comments on commit 31e9017

Please sign in to comment.