event_archive()
Archive PATROL events that match the specified filter criteria.
Syntax
event_archive(filename,operation,[separator],[format],
[start-time],[stop-time],[status],[type],[node],
[origin],[pattern],[IDrange],[class],
[severity],[max-count])
Parameters
Parameter | Definition |
filename | string that is the name of the file where the archived events are written |
operation | string that specifies the file access used for archiving events *Valid Values* |
separator | character string used to separate events in the archive file If " " is specified, the event_archive() function uses the newline character ( \n ) to separate events. |
format | format string used to present each event entry See Specifying the event_query() Output Format .Default
|
FILTER: | |
start-time | time endpoint that specifies the oldest event timestamp that is valid for the |
stop-time | time endpoint that specifies the most recent event timestamp that is valid for the event archival *Valid Values*
where the valid ranges of the arguments are: |
status | event status that is valid for the event archival *Valid Values*
|
type | event type that is valid for the event archival *Valid Values*
|
node | computer system name that is valid for the event archival *Valid Values* |
origin | application instance or class name that is valid for the event archival *Valid Values* |
pattern | character string within the event description field that is valid for the event archival *Valid Values* |
IDrange | string that defines the range of PATROL event IDs that are valid for the event archival *Valid Values* x event ID x |
class | event class that is valid for the event archival *Valid Values* |
severity | lowest event severity that is valid for the event archival *Valid Values* |
max-count | maximum number of events to write to the file If more events are available than the max-count, the Default |
Note
When the two digit year, yy, is specified with the PSL compatible time format for the start-time and stop-time parameters, the function assumes the year is 19 yy. You should either omit the year when using this format, or use a different date format if you need to specify the year.
Description
The event_archive() function writes PATROL events that match the filter criteria from the PATROL event repository to filename using format and separator. The event_archive() function returns the string OK if successful, or the NULL string if not.
Example
The following example appends events matching the default event filter to the file*/tmp/myarchive* using a new-line separator:
event_archive("/tmp/myarchive","A","","");
The following example overwrites the existing file $PATROL_HOME/log/myarchive with the event description text for events that match the default event filter, separated by new-line characters.
event_archive("myarchive","W","\n","%{EV_DESC}");
The following example overwrites the existing file $PATROL_HOME/log/myfile with events matching the specified filter. The event_archive() function uses the default separator and format.
event_archive(
"myfile",# archive file $PATROL_HOME/log/myfile
"A",# append events to existing file
"",# default separator
"",# default format
"",# any start time
"",# any stop time
"",# any status
"",# any type
"",# any node
"",# any origin
"",# any event description
"",# all event IDs
"",# any event class
"2"# event severity 2 or greater
);
Comments
Log in or register to comment.