Job Management Partner 1/Base User's Guide
Function
The jevexport command outputs the event database to a CSV file.
Format
jevexport [-h event-server-name] [-i event-database-file-name] [-o output-file-name] [-f filter-file-name] [-t {ON | OFF}] [-k items-file-name] [-a]
Required execution permission
In Windows: None.
In UNIX: None.
Command directory
- In Windows:
- installation-folder\bin\
- In UNIX:
- /opt/jp1base/bin/
Arguments
-h event-server-name
Specify an event server name to be output to a CSV file. If you omit this option, the logical host name set in the environment variable JP1_HOSTNAME is assumed as the event server name. If the environment variable JP1_HOSTNAME is not set, the event server name is assumed to be the same as the local host name. Specify the event server name as a character string of no more than 255 bytes.
You cannot specify this option with the -i option.
-i event-database-file-name
Specify an event database file name to be output to a CSV file. You can specify the file name of an event database backed up by an OS backup command or the jevdbinit command. If you omit the path, the current directory is assumed.
You cannot specify this option with the -h option.
-o output-file-name
Specify a CSV file name by a character string that is no more than 255 bytes. If you specify an existing file, the event database contents will replace the data in that file. If you omit this option, the contents are output to a file named imevexport.csv in the current directory. JP1 events are output in date order, starting from the oldest.
-f filter-file-name
Specify a text file that contains the conditions for outputting selected JP1 events registered in the event database. The text file name must be no more than 255 bytes. In a filter file, you can specify each filter in the same format used for an event filter. For details, see Event filter syntax in 14. Definition Files. If you omit this option, all JP1 events registered in the event database will be output to the CSV file.
- Note
- If the locale (for example, specified for the environment variable LANG) when executing the jevexport command differs from the character code used for character strings specified as conditions for JP1 events, no JP1 events are output to the CSV file.
-t {ON | OFF}
Specify ON to convert the time notation from the number of seconds since UTC 1970-01-01 00:00:00 to YYYYMMDDhhmmss format. This applies to the registration time and arrival time of JP1 events, and the START_TIME and END_TIME (common information of extended attributes). Specify OFF if you do not want to convert the time notation. If you omit this option, operation is the same as specifying OFF.
-k items-file-name
Specify a text file that contains the names of the extended attributes (program-specific information) to be output to the CSV file. The text file name must be no more than 255 bytes. When the -k option is specified, the command outputs only the extended attributes (program-specific information) from the event database that are written in the items file. All program-specific information is output to CSV files by default. All the shared information items for basic attributes and extended attributes are output.
The coding conventions are as follows:
- Write the names of the program-specific information that you want to output to a CSV file, starting from the beginning of the file (byte 1).
- Either omit the program-specific items that you do not want to output, or comment them out (write a # at the start of the line).
- Write an @ prefix before the names of program-specific items expressed in number of seconds since UTC 1970-01-01 00:00:00.
This converts them into YYYYMMDDhhmmss format.
If no value is specified for a program-specific item, and the item's name has the prefix @, the name is converted to the year format, assuming 0. For example, the value TZ=JST-9 is converted to 19700101090000.
The following examples illustrate these conventions for writing an items file.
AAA <- No time conversion @BBB <- Convert to YYYYMMDDhhmmss format. #CCC <- Comment line-a
Specify this option to output the title names of the basic attribute and extended attribute as header lines at the top of the CSV file. As the program-specific information in the extended attributes is output as pairs of attribute names and values, the extended attribute name is output as a title for the first pair only and is omitted thereafter.
Notes
- If a space appears in the output file name, filter file name, or items file name, enclose the file name in double quotation marks (").
- If the event database is switched while this command is running, the command immediately stops CSV output and outputs a message. In such a case, the output information in the CSV file is not guaranteed. You can re-execute the command to output valid information.
- The command guarantees CSV output as much as the size of the event database specified in the event server setting file (conf). If you want to save all event information, you should periodically use the -f option to execute a filter file containing the WITHIN comparison keyword or other keywords before the event database is switched. For details on the event database size, see Event server settings file in 14. Definition Files.
- When you use this command to output events in JP1/SES format to a CSV file, events that include double quotation marks might be incorrectly converted, since events in JP1/SES format do not have the code set.
- The event ID is output in CSV format as a hexadecimal number. Your spreadsheet software might display an event ID in exponential format if it matches a exponential representation (for example, 000020E0). You can view the event ID in text format by opening the file as plain text.
- If you output a corrupted event database to the CSV file, the uncorrupted data will be output normally, but message KAJP1765-W will be output for the corrupted records.
Return values
0 Normal end 1 Invalid argument 2 Output to a CSV file was canceled during processing of the command. 3 A corrupted record was detected in the event database. 255 Other error
Example
The following shows some examples of use.
From the event database named Service, extract only the JP1 events that match the filter conditions written in the file filter.txt, convert the program-specific information specified in the file conf.txt into CSV format, and output the data to the file csvconv.csv.
jevexport -h Service -o csvconv.csv -f filter.txt -k conf.txt
All Rights Reserved. Copyright (C) 2009, Hitachi, Ltd.