예제 #1
0
파일: policy.go 프로젝트: postfix/bangarang
func (p *Policy) CheckNotMatch(e *event.Event) bool {
	for k, m := range p.r_not_match {
		if m.MatchString(e.Get(k)) {
			return false
		}
	}
	return true
}
예제 #2
0
파일: policy.go 프로젝트: postfix/bangarang
// check if any of p's matches are satisfied by the event
func (p *Policy) CheckMatch(e *event.Event) bool {
	for k, m := range p.r_match {
		// if the element does not match the regex pattern, the event does not fully match
		if !m.MatchString(e.Get(k)) {
			return false
		}
	}
	return true
}
예제 #3
0
func (t *Tracker) trackEvent(e *event.Event) {

	// don't track internal events
	if len(e.Get(INTERNAL_TAG_NAME)) != 0 {
		return
	}
	t.total.inc()
	t.updateCounts(e)
	t.updateTimes(e)

}