Skip to content

Instantly share code, notes, and snippets.

@regel
Created December 5, 2018 18:03
Show Gist options
  • Save regel/61d034a55accbda08d01901dacbefa72 to your computer and use it in GitHub Desktop.
Save regel/61d034a55accbda08d01901dacbefa72 to your computer and use it in GitHub Desktop.
TICK-1 section 3
var pos = data
// the next node counts abnormal data points
|stateCount(lambda: "is_anomaly" == TRUE)
|alert()
// Warn after 1 point
.warn(lambda: "state_count" >= 1)
// Critical after 5 points and abnormal higher than 90 / 100
.crit(lambda: "state_count" >= 5 AND "score" > 90.0)
.message('{{ .Time }}: Hey, unexpected situation detected by model={{ index .Fields "model" }} state=ongoing score={{ index .Fields "score" | printf "%0.3f" }}.')
.slack()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment