Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

replacecharhandler.h File Reference


Detailed Description

This handler acts similarly to the Unix command 'tr'. Those events that are received with a string value have their characters substituterd and will be copied and sent to the associated copy address. You may have variable numbers of 'tr' filters. The name: option changes the 'tr' from evaluating the event's value to evaluating the event's name, thus allowing you to break an event stream into channels of events based on event name. The source: option changes the 'tr' from evaluating the event's value to evaluating the event's source, thus allowing you to break an event stream into channels of events based on event source.

Wire keywords (standard handler keywords documented in Wire )

You my have multiple tr: lines. Value example:

// Events from the process table have quotes, we don't want quotes
set noquotes create event { name: "noquotes"  priority: 1 }

// tr
create handler replacechar { 
 tr: $noquotes "'" " "
 regevent: $psevents
}

Events accepted when filtering value:
TypeDescription
AW_EVENT_TYPE_STRING Apply tr to event
Events generated when filtering value:
Event NameTypeDescription
copy AW_EVENT_TYPE_STRING Copy of original event with substituted string
Events accepted when filtering name:
TypeDescription
any Copy of original event with substituted string
Events generated when filtering source:
Event NameTypeDescription
copy any Copy of original event with substituted string

#include "monitor.h"
#include "wire.h"
#include "regexmatch.h"

Go to the source code of this file.

Data Structures

struct  aw_replacechar_tr_filter_t
 Event to generate w/tr. More...

struct  aw_replacecharhandler_t
 Replacechar handler object. More...


Functions

aw_replacecharhandler_t * aw_create_replacecharhandler (u_int32_t nfilters, aw_replacechar_tr_filter_t *filters, u_int32_t alternate, 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 string filter handler.

void aw_free_replacecharhandler (aw_replacecharhandler_t *h)
 Free handler and all associated resources.

aw_handler_t * aw_wire_replacecharhandler (aw_wire_mkhandler_args_t *args)
 Create a replacecharhandler using "wire". See header doc for keyword documentation.


Function Documentation

aw_replacecharhandler_t* aw_create_replacecharhandler (  u_int32_t  nfilters,
aw_replacechar_tr_filter_t *  filters,
u_int32_t  alternate,
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 string filter handler.

aw_create_replacecharhandler

Parameters:
nfilters How many filters
filters Event filters, if range match is true, generate event
alternate If 1 indicates you want to filter on name, if 2 on source rather than value
regevent Function pointer for event registration
regmaskevent Function pointer for event mask registration
sched Run schedule
logger Logger object
Returns:
Handler object

void aw_free_replacecharhandler (  aw_replacecharhandler_t *  h  ) 
 

Free handler and all associated resources.

aw_free_replacecharhandler

Parameters:
h The handler

aw_handler_t* aw_wire_replacecharhandler (  aw_wire_mkhandler_args_t *  args  ) 
 

Create a replacecharhandler using "wire". See header doc for keyword documentation.

aw_wire_replacecharhandler

Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)