The priority: option changes the range check from evaluating the event's value to evaluating the event's priority, thus allowing you to break an event stream into channels of events based on priority.
Wire keywords (standard handler keywords documented in Wire )
Value filter example:
// assume $memused is bound to events generated // by memprobe which relays the used memory in the system // and you want to be notified if it gets higher than 90% set highmem create event { name: "low mem" priority: 100 }
// filter create handler rfilter { filter: $highmem 90.0 100 regevent: $memused }
// alert create handler execp { cmd: "mail -s \"Alert: $n\" sysadmin" input: "Alert:\n \$n \$v\n\n" regevent: $highmem }
Priority filter example:
// Assume that $allevents is bound to all defined // events and further assume you carefully assign priorities to // all events and that you only want to be alerted on // the "high" priority events.
set alert create event { name: "alert" }
// filter create handler rfilter { priority: filter $alert 50 100 regevent: $allevents }
// alert create handler execp { cmd: "mail -s \"Alert: $n\" sysadmin" input: "Alert:\n \$n \$v\n\n" regevent: $alert }
Events accepted when filtering value:
| Type | Description |
|---|---|
| AW_EVENT_TYPE_INT32 | AW_EVENT_TYPE_INT64 | AW_EVENT_TYPE_FLOAT32 | AW_EVENT_TYPE_FLOAT64 | AW_EVENT_TYPE_TIMESTAMP | Apply range test to event, if value in range then generate a copy |
Events generated when filtering value:
| Event Name | Type | Description |
|---|---|---|
| copy | AW_EVENT_TYPE_INT32 | AW_EVENT_TYPE_INT64 | AW_EVENT_TYPE_FLOAT32 | AW_EVENT_TYPE_FLOAT64 | AW_EVENT_TYPE_TIMESTAMP | copy of original event that passed the filter |
Events accepted when filtering priority:
| Type | Description |
|---|---|
| any | Apply range test to event, if priority in range then generate a copy |
Events generated when filtering priority:
| Event Name | Type | Description |
|---|---|---|
| copy | any | copy of original event that passed the filter |
#include <stdio.h>
#include "monitor.h"
#include "wire.h"
Go to the source code of this file.
Data Structures | |
| struct | aw_rfilter_range_filter_t |
| Event to generate w/range match. More... | |
| struct | aw_rfilterhandler_t |
| Rfilter handler object. More... | |
Functions | |
| aw_rfilterhandler_t * | aw_create_rfilterhandler (u_int32_t nfilters, aw_rfilter_range_filter_t *filters, u_int32_t priority, int32_t(*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), int32_t(*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), const aw_alarm_sched_t *sched, aw_logger_t *logger) |
| Create a range filter handler. | |
| void | aw_free_rfilterhandler (aw_rfilterhandler_t *h) |
| Free handler and all associated resources. | |
| aw_handler_t * | aw_wire_rfilterhandler (aw_wire_mkhandler_args_t *args) |
| Create a rfilterhandler using "wire". See header doc for keyword documentation. | |
|
||||||||||||||||||||||||||||||||
|
Create a range filter handler. aw_create_rfilterhandler
|
|
|
Free handler and all associated resources. aw_free_rfilterhandler
|
|
|
Create a rfilterhandler using "wire". See header doc for keyword documentation. aw_wire_rfilterhandler |