Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save imweijh/c917ad22957efe6a93eaacc763242ce7 to your computer and use it in GitHub Desktop.
Save imweijh/c917ad22957efe6a93eaacc763242ce7 to your computer and use it in GitHub Desktop.
Metricbeat / Timelion / Kibana anomaly detection expression
$thres=0.02, .es(index='metricbeat*',metric='max:system.cpu.user.pct').lines(1).if(eq, 0, null).holt(0.9, 0.1, 0.9, 0.5h).color(#eee).lines(10).label('Prediction'), .es(index='metricbeat*',metric='max:system.cpu.user.pct').color(#666).lines(1).label(Actual), .es(index='metricbeat*',metric='max:system.cpu.user.pct').lines(1).if(eq, 0, null).holt(0.9, 0.1, 0.9, 0.5h).subtract(.es(index='metricbeat*',metric='max:system.cpu.user.pct')).abs().if(lt, $thres, null, .es(index='metricbeat*',metric='max:system.cpu.user.pct')).points(10,3,0).color(#c66).label('Anomaly').title('max:system.cpu.user.pct / @rmoff')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment