 |
Index for Section 1 |
|
 |
Alphabetical listing for E |
|
 |
Bottom of page |
|
evmshow(1)
NAME
evmshow - Displays an EVM event
SYNOPSIS
evmshow [[-d | -D | -x] [-t show_template] | -r]
[-c config_file] [-f filter_expr] [-F]
[-k skip-count] [-n show-count]
[filename | -]
OPTIONS
-c config_file
Uses config_file as the channel configuration file instead of the
default file, /etc/evmchannel.conf. The channel configuration file is
read when the -d or the -x flag is used.
-d Outputs each event as a full multiline detailed display, using the
details function (fn_details) defined for the event in the channel
configuration file /etc/evmchannel.conf.
-D Outputs each event as a multiline dump of the contents of the event.
This format does not include explanation text or any additional details
about the event.
-r Does not format events, but outputs each event as a raw (binary) event.
This flag results in an error if stdout is directed to a terminal
device.
-x Outputs the explanation text for the event. The explanation is
obtained using the explanation function (fn_explain) defined for the
event in the channel configuration file /etc/evmchannel.conf.
-t show_template
Outputs each event as a formatted line using the specified
show_template. If this flag is used in conjunction with
-d, -D or -x, the formatted line is output first followed by the
multiline output resulting from the other flag.
-f filter_expr
Outputs only events that match the filter_expr. See the EvmFilter(5)
reference page for the filter syntax.
-F Echoes any specified filter string to stdout, and terminates. If the
filter specified with the -f option refers to a stored filter, the
filter is expanded before being displayed. This feature is useful for
retrieving filter strings from a file. This flag cannot be used in
conjunction with any other output format control flag.
-k skip-count
Skips the first skip-count events from the input stream before
beginning output. If skip-count exceeds the number of events in the
input stream, no output is produced.
-n show-count
Stops producing output after show-count events have been output. If
show-count exceeds the number of events in the input stream, all events
are output.
OPERANDS
filename
Reads events from file filename. If filename is omitted, or is
specified as -, events are read from stdin.
DESCRIPTION
The evmshow command takes as input one or more EVM events and writes them
to stdout in the requested format. Events are read from file filename if
it is specified, or from stdin if - is specified as filename or if no file
is specified.
If neither the -d or the -D flag is specified, each event is formatted
according to the following rules, and written to stdout as a single line of
text.
If the -t flag is included, the supplied show-template string is used to
format the event. If the -t flag is omitted but the variable
EVM_SHOW_TEMPLATE is present in the environment, the value of the variable
is used as the show-template. If no show-template is available, a default
value of @@ is used. See the explanation below for the meaning of this
value.
A show-template is a string that may contain event data item specifiers of
the form @item_name[%width], where item_name is the name of any standard
event data item, such as timestamp or priority (see the EvmEvent(5)
reference page for a complete list), and width, if specified, is the
minimum number of character spaces the value should occupy.
If a show-template is available, evmshow replaces each specifier in the
template with the value of the corresponding data item from the event,
producing an output string containing only the required items. Any
characters in the show_template that are not part of an item specifier are
output unchanged, providing a convenient way to insert literal strings,
punctuation and spacing characters.
For example, show-template "@timestamp [@priority] @name" would cause each
event read by evmshow to be displayed as a single line of text.
The output displayed which, is comprised of the date, time, priority of the
event enclosed in brackets, and then the event name, appears as follows:
03-Feb-2000 02:00:00 [200] sys.unix.evm.chmgr.cleanup_done
The special show-template specifier @@ is replaced with the event's
formatted text, produced by taking the format data item and replacing any
embedded variable specifiers (beginning with $) with the corresponding
variable value, and replacing any data item specifiers (beginning with @)
with the corresponding data item. The show-template "@timestamp
[@priority] @@" would result in an output display as follows:
03-Feb-2000 02:00:00 [200] EVM channel mgr: Log cleanup completed
If an item specified in the show_template is not present in the event, the
character - is output in its place. An @ character not associated with a
valid item name is unchanged in the output. If it is necessary to have an
@@ sequence in the output, the @ characters should be escaped with
backslashes (\).
The -f flag can be used to specify an EVM filter string, to limit the
events that are passed through evmshow. If a filter_expr is supplied, only
events that match the filter_expr are output.
The -r flag can be used in combination with the -f, -k and -n flags to make
evmshow act as a filter, reading a stream of events and writing only those
that meet the selection criteria specified by the other flags.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of evmshow:
EVM_SHOW_TEMPLATE
This variable contains a string formatted as described for a
show-template. If the -d, -D, -t, and -x flags are omitted, the
string is used as the show-template for output.
NOTES
The -r flag should not be used when output is sent indirectly to a terminal
device, such as piping the output of the evmshow command to the more
command.
RESTRICTIONS
The evmshow command rejects attempts to output raw events to a terminal
device.
EXAMPLES
In the following example, all available events are retrieved and piped to
evmshow for formatting. The show-template causes the events to be
displayed as timestamp value, followed by the event's priority enclosed in
brackets, followed by the formatted event message.
evmget | evmshow -t "@timestamp [@priority] @@"
This ksh example displays events in the same way as the previous example,
but the show-template is specified in an environment variable, simplifying
the evmshow command.
export EVM_SHOW_TEMPLATE="@timestamp [@priority] @@"
evmget | evmshow
The following example retrieves all available events using evmget, and
sorts them into a file. In the evmsort command, the -s option requests
that the events be sorted into timestamp order, and the hyphen character at
the end of the sort specification indicates that the sort order should be
descending. This results in the most recent events appearing first. The
evmshow command is then used to display full details (indicated by the -d
flag) of the first five (most recent) events from the file.
evmget | evmsort -s "@timestamp-" > my_eventfile
evmshow -n 5 -d my_eventfile | more
The following example displays the value of the filter named evm, from the
sys filter file.
evmshow -f "@sys:evm" -F
The following example watches for events of priority 600 or greater, and
mails them in detailed display format to user jim, with a subject line that
identifies the event. In the evmshow command, the -t flag produces the
subject line as the first line of the output, and the -d flag causes
evmshow to follow the subject line with a detailed display of the event.
The mail command uses the line beginning with Subject: as the subject for
the mail message.
evmwatch -f "[priority >= 600]" |
evmshow -t "Subject: EVENT [@priority] @@" -d | mail jim
The following example reads raw EVM events from the file file1 and writes
the events that have a priority of 500 or greater to file2. Because the -r
flag is specified, the output file contains raw EVM events.
evmshow -r -f "[priority >= 500]" file1 > file2
The following example uses the evmwatch -i option to request a list of all
event templates from the EVM daemon, and then uses evmshow to display the
name and priority of each template, followed by its explanation text.
Refer to the evmtemplate reference page for details of event templates.
evmwatch -i | evmshow -t "@name [@priority]" -x | more
EXIT VALUES
The following exit values are returned:
0 Successful completion
not 0
An error occurred
FILES
/etc/evmchannel.conf
Location of the EVM channel configuration file.
SEE ALSO
Commands: evmget(1), evminfo(1), evmpost(1), evmsort(1), evmwatch(1)
Routines: EvmEventFormat(3)
Files: evmchannel.conf(4), evmfilterfile(4), evmtemplate(4)
Event Management: EVM(5)
EVM Events: EvmEvent(5)
Event Filter: EvmFilter(5)
 |
Index for Section 1 |
|
 |
Alphabetical listing for E |
|
 |
Top of page |
|