You can use a command line interface to query the event database.
Purpose
Generates a report listing events in the event
database.
wsadmin -f eventquery.jacl [-globalinstanceid global_instance_id | -group event_group] [-severity severity] [-extensionname extension_name]
[-start start_time] [-end end_time]
[-number number] [-ascending|-descending]
Description
The eventquery.jacl script
queries the event database and generates a report that lists the result. You
can query events based on the event group, the severity, or the extension
name. You can also query events that were created during a specified period
of time.
Parameters
- -globalinstanceid global_instance_id
- The global instance identifier of the event to query. Either this parameter
or -group (but not both) is required.
- -group event_group
- The event group from which to query events. The event_group value
must be the name of an event group defined in the Common Event Infrastructure
configuration. Either this parameter or -globalinstanceid (but
not both) is required.
- -severity severity
- The severity of the events that you want to include in the report. The severity value
must be an integer. Only events with a severity equal to the value that you
specify are included in the report. This parameter is optional.
- -extensionname extension_name
- The extension name of events that you want include in the report. Use
this parameter to restrict the query to events of a specific type. Only events
with the extensionName property equal to extensionName are
included in the report. This parameter is optional.
- -start start_time
- The earliest time of the events that you want to include in the report.
Use this parameter to restrict the query to events that were generated after
a specified date and time. This parameter must be a date and time that is
specified according to the XML dateTime data type. The basic format is CCYY-MM-DDThh:mm:ss,
optionally followed by a time zone indicator. For example, noon on 1 January
2004 in Eastern Standard Time is 2004-01-01T12:00:00-05:00.
For more information about the dateTime data type, refer to the XML schema
at www.w3.org.
- -end end_time
- The latest time of the events that you want to include in the report.
Use this parameter to restrict the query to events that were generated before
a specified date and time. This parameter must be a date and time that is
specified according to the XML dateTime data type. For more information, see
the description of the -start parameter.
- -number number
- The maximum number of events that you want to include in the report. This
parameter must be an integer. If the number of matching events in the database
exceeds the specified value, the report is truncated. If the report is sorted
in ascending order, this means that the most recent matching events are omitted.
If the report is sorted in descending order, the oldest matching events are
omitted.
- -ascending|-descending
- The chronological order in which the events in the report are sorted.
This must be one of the following values:
- ascending
- Ascending (chronological) order, with the oldest events first. This is
the default value.
- descending
- Descending (reverse chronological) order, with the most recent events
first.
Example
The following example lists all of the events
from the database that belong to the All events event group and were
generated on 17 February 2004. The report is sorted in reverse chronological
order:
eventquery.jacl -group "All events" -start "2004-02-17T00:00:00-05:00"
-end "2004-02-17T23:59:59-05:00" -order DESC