21 lines
454 B
Go
21 lines
454 B
Go
package kapacitor
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/influxdata/chronograf"
|
|
)
|
|
|
|
// InfluxOut creates a kapacitor influxDBOut node to write alert data to Database, RP, Measurement.
|
|
func InfluxOut(rule chronograf.AlertRule) string {
|
|
return fmt.Sprintf(`
|
|
trigger
|
|
|influxDBOut()
|
|
.create()
|
|
.database(output_db)
|
|
.retentionPolicy(output_rp)
|
|
.measurement(output_mt)
|
|
.tag('name', '%s')
|
|
`, rule.Name)
|
|
}
|