File Field Layout
The fields within the log file must be described using the file field layout. Up to 70 fields can be defined. It is not necessary to define all the fields within a file. You only need to define the fields you actually need to use. Different fields are displayed dependent on the file type being used.
In most cases, Log File Monitor will attempt to auto-detect the field layout. In some cases they need to be defined manually.
The following fields are available:
Start
Specifies the starting position of the fixed field within the record.
Number
Specifies the ordinal field number in a CSV file rather than the start position. Ordinal data is a categorical, statistical data type where the variables have natural, ordered categories and the distances between the categories is not known.
Len
Specifies the length of the field.
This is the buffer length in bytes, not the number of decimal positions or characters. For example, a 10 character *CHAR field will be 10 long, but a 10 character *DBCS field will be 20 long and a 10 character *VARY field will be 12 long.
Dec
Specifies the number of decimal positions. You don’t specify Dec for *NUM or *FLOAT field types.
Name
Specifies the name of the field.
- With QSYS.LIB externally described files, the name defined within the file is used (except for timestamp fields which are defined as 3 separate date, time and sequence fields). With other file types, an arbitrary field name is assigned.
- With *CSV and *FIXED files that have a header record, the field name is derived from the header.
- With *XML, the single field is named XMLDATA.
- With all other files, the field name is simply FLD0001, FLD0002, and so on.
The user is free to rename any field as desired, including QSYS.LIB externally described files. If you rename a field, other references to it in the rule group are updated automatically.
Type
Indicates the type of field. These can be:
Var
Optionally maps a substitution variable to the field. Both normal and calculated fields can be mapped.
You can only map a field to the Log File Monitor field variables, &F1 - &F70. These variables can then be used in actions invoked by a Log File alert.
You can add a Log File field into an action either by typing the &Fn variable name mapped to it, or by typing the field name prefixed with a percentage sign (%) and suffixed with a semi-colon (;) (this may be omitted if the character immediately following the field name is not upper case A-Z or 0-9), or by using F18=Select Log File Field and then selecting a field from this list. If you type or select a Log File field that does not have an allocated variable, a variable is allocated automatically.
If you type the &Fn variable name, it is converted to the equivalent %Field name.
Description
Specifies a text description of the field.
- With QSYS.LIB externally described files, this comes from either the TEXT or COLHDG attribute.
- With CSV files that have a header record, it is the value from the header.
- With all other files, it is set the same as the field name assigned.
F
An asterisk (*) under the F column on the right on the display indicates that a function has been attached to this field. You can attach functions to any defined field. You can also create special stand-alone *CALC fields. These require a function.
Field Types
The following field types are supported in the File Field Layout page used when creating a Log File rule group: