Code Monkey home page Code Monkey logo

Comments (3)

buro1983 avatar buro1983 commented on July 23, 2024

This is my tickscript. One more observation. I am asking Morgoth to run in every 1min interval. But when I looked into debug log, it is different.

If logging stats at 11:01:00, then
next log comea at 11:02:00, which is fine, but
next logs comes at 12:02:00 which I don't understand. Does that means algo is not doing anything for 1 hr?

// The measurement to analyze
var measurement = 'cpu'

// Optional group by dimensions
var groups = []

// Optional where filter
var whereFilter = lambda: TRUE

// The amount of data to window at once
var window = 1h
var interval = 1m

// The field to process
var field = 'usage_idle'

// The name for the anomaly score field  
var scoreField = 'anomalyScore'

// The minimum support
var minSupport = 0.95

// The error tolerance
var errorTolerance = 0.01

// The consensus
var consensus = 0.5

// Number of sigmas allowed for normal window deviation
var sigmas = 3.5

var details = 'This mail is getting generated when %change of {{.ID}} in last 1hour'
var message = '[{{ .Level }}] Terago {{.ID}} , Difference: {{ index .Fields "value" }} , {{.Time}}'

var idTag = 'alertID'

var levelTag = 'level'

var messageField = 'message'

var durationField = 'duration'

var rp = 'autogen'
var db = 'telegraf'
var name = 'cpu alert'
var triggerType = 'relative'
var idVar = name + ':{{.Group}}'
var outputDB = 'alertsDB'
var outputMeasurement = 'cpu_1h'

var trigger = stream
   // Select the data we want
  |from()
      .database(db)
      .retentionPolicy(rp)
      .measurement(measurement)
     .groupBy(groups)
     .where(whereFilter)
  // Window the data for a certain amount of time
  |window()
     .period(window)
    .every(interval)
    .align()
  // Send each window to Morgoth
  @morgoth()
     .field(field)
    .scoreField(scoreField)
    .minSupport(minSupport)
    .errorTolerance(errorTolerance)
    .consensus(consensus)
   // Configure a single Sigma fingerprinter
   .sigma(sigmas)
 // Morgoth returns any anomalous windows
  |alert()
     .stateChangesOnly()
     .details(details)
    .message(message)
    .id(idVar)
    .idTag(idTag)
    .levelTag(levelTag)
    .messageField(messageField)
    .durationField(durationField)
    .details(details)
    .crit(lambda: TRUE)
    .log('/tmp/cpu_1h.log')  
trigger
    |influxDBOut()
        .create()
        .database(outputDB)
        .retentionPolicy(rp)
        .measurement(outputMeasurement)
        .tag('alertName', name)
        .tag('triggerType', triggerType)

trigger
    |httpOut('output')

from morgoth.

negbie avatar negbie commented on July 23, 2024

Same here. Todays latest tick stack.

from morgoth.

alextodicescu avatar alextodicescu commented on July 23, 2024

So, anybody found the answer to this?
I initially had this problem, fixed it at some point and now have the same issue again (but forgot what I did to fix it haha)

from morgoth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.