Hitachi

JP1 Version 12 JP1/Base User's Guide


jevexport

Organization of this page

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}]
          [-l encoding-name]
          [-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 (extension: dat) 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 16. 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.

-l encoding-name

When converting data to CSV format, the jevexport command converts character strings in the event database to the encoding specified in this option. If you omit this option, the converted data retains the encoding of the event database. You can specify the following encodings:

  • SJIS

  • EUCJIS

  • ISO2022JP

  • UTF-8

-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.

To output these items in Japanese, specify an encoding in the encoding name attribute of the -l option. If you omit the -l option, the titles are output in English.

Notes

Return values

0

Normal end

1

Invalid argument

2

CSV output was interrupted because the event database was switched during command processing

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