![]() |
![]() |
[ Bottom of Page | Previous Page | Next Page | Contents | Index ]
write(_file, _term)
The value of _term is written to the file specified by the file pointer _file. Newline characters are not written.
This following example Tivoli Enterprise Console rule shows how to write data to the /tmp/event.txt file. It is not generally a good idea to write data to a file every time an event is received because it will degrade the performance of the event server.
rule: write: (
event: _event of_class _class,
action: write_assertions: (
fopen(_fp, '/tmp/event.txt', 'w'),
write(_fp, 'Event of class '),
write(_fp, _class),
write(_fp, ', '),
write(_fp, _source),
write(_fp, ' received.\n')
),
action: close: (
fclose(_fp)
)
).
If an event of class Su_Success with source LOGFILE was sent, then the /tmp/event.txt file would contain the following text after the rule ran:
Event of class Su_Success, LOGFILE received.
None.
[ Top of Page | Previous Page | Next Page | Contents | Index ]