influxdata / kapacitor

Open source framework for processing, monitoring, and alerting on time series data
MIT License
2.31k stars 492 forks source link

failed to aggregate batch: field packets_sent missing from point cannot aggregate #1275

Closed pt1988 closed 7 years ago

pt1988 commented 7 years ago

I collect network counter every 1 minute then testing kapacitor to alert with simple threshold but it not working and show log like this. "E! failed to aggregate batch: field packets_sent missing from point cannot aggregate" this is my TICKscript: var db = 'telegraf' var rp = 'autogen' var measurement = 'net' var groupBy = ['host'] var whereFilter = lambda: ("host" == 'FW-GW1') var period = 1m var every = 30s var name = 'FW NET' var idVar = name + ':{{.Group}}' var message = '{{.Name}} {{.Level}} for {{ index .Tags "host" }}' var idTag = 'alertID' var levelTag = 'level' var messageField = 'message' var durationField = 'duration' var outputDB = 'chronograf' var outputRP = 'autogen' var outputMeasurement = 'alerts' var triggerType = 'threshold' var crit = 800 var data = stream |from() .database(db) .retentionPolicy(rp) .measurement(measurement) .groupBy(groupBy) .where(whereFilter) |window() .period(period) .every(every) .align() |mean('packets_sent') .as('value')

var trigger = data |alert() .crit(lambda: "value" > crit) .stateChangesOnly() .message(message) .id(idVar) .idTag(idTag) .levelTag(levelTag) .messageField(messageField) .durationField(durationField) .slack()

trigger |influxDBOut() .create() .database(outputDB) .retentionPolicy(outputRP) .measurement(outputMeasurement) .tag('alertName', name) .tag('triggerType', triggerType)

trigger |httpOut('output')

nhaugo commented 7 years ago

@pt1988 We try to keep github issues to bug reports and feature requests, can you please send questions to https://community.influxdata.com