We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The generatd tickscript is erroring out when trying to save the alert rule, though TICK syntax is valid.
The error is like: parser: unexpected ) line 7 char 67 AND ("ho".expected:"number","string","duration","identifier","TRUE","FALSE"(","-"",!
The generated tick script is like:
var critIO = 70
var highIO = 50
var crit = critIO + 1
var critReset = highIO + 4
var db = 'telegraf'
var rp = 'autogen'
var measurement = 'cpu'
var groupBy = ['host']
var whereFilter = lambda: (isPresent("cpu") AND "cpu" == 'cpu-total') AND ("host" == hostDevice)
var period = 30s
var every = 30s
var idVar = name
var message = 'High IOWait detected on {{ index .Tags "host" }}. Current value: {{ index .Fields "usage_iowait" }}'
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 data = stream |from() .database(db) .retentionPolicy(rp) .measurement(measurement) .groupBy(groupBy) .where(whereFilter) |window() .period(period) .every(every) .align() |max('usage_iowait') .as('value')
var trigger = data |alert() .crit(lambda: "value" > crit) .critReset(lambda: "value" < critReset) .stateChangesOnly() .message(message) .id(idVar) .idTag(idTag) .levelTag(levelTag) .messageField(messageField) .durationField(durationField) .slack()
trigger |eval(lambda: float("value")) .as('value') .keep() |influxDBOut() .create() .database(outputDB) .retentionPolicy(outputRP) .measurement(outputMeasurement) .tag('alertName', name) .tag('triggerType', triggerType)
trigger |httpOut('output')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The generatd tickscript is erroring out when trying to save the alert rule, though TICK syntax is valid.
The generated tick script is like:
var critIO = 70
var highIO = 50
var crit = critIO + 1
var critReset = highIO + 4
var db = 'telegraf'
var rp = 'autogen'
var measurement = 'cpu'
var groupBy = ['host']
var whereFilter = lambda: (isPresent("cpu") AND "cpu" == 'cpu-total') AND ("host" == hostDevice)
var period = 30s
var every = 30s
var idVar = name
var message = 'High IOWait detected on {{ index .Tags "host" }}. Current value: {{ index .Fields "usage_iowait" }}'
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 data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|window()
.period(period)
.every(every)
.align()
|max('usage_iowait')
.as('value')
var trigger = data
|alert()
.crit(lambda: "value" > crit)
.critReset(lambda: "value" < critReset)
.stateChangesOnly()
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.slack()
trigger
|eval(lambda: float("value"))
.as('value')
.keep()
|influxDBOut()
.create()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag('alertName', name)
.tag('triggerType', triggerType)
trigger
|httpOut('output')
The text was updated successfully, but these errors were encountered: