Configuring the adapter Context and Configuration for a rule-based adapter
In the Adapter Configuration File, the context describes the ordered grouping of components
as they are chained together for log file processing.
Each log file has a separate context, and multiple contexts can be defined in a single configuration.
Configuring the Context
The context can be configured to process components in a single thread or in multiple threads.
A multi-threaded context can be used in cases where there are multiple components that can be run in parallel,
for example, multiple outputters. To configure the context:
- In the left pane of the Adapter Configuration Editor, expand the Adapter node and then the Contexts node. Select Context Basic Context Implementation. The right pane displays the Basic Context Implementation information.
- Update the Executable class with one of the available context implementations.
See the Adapter Configuration File structure for a list of valid classes.
- Check that Contexts is selected as the Role.
- Update other fields of the context as required.
- Save the changes.
Configuring a context instance in the configuration
Multiple contexts can be defined in a single configuration. To configure a context instance in a configuration:
- In the left pane of the Adapter Configuration Editor,
expand the Configuration node. Select Context Instance.
The right pane displays the Context Instance information.
- Select Continuous operation if you want the log file to be monitored for changes continuously.
If continuous operation is selected, specify the Maximum Idle Time and Pause Interval
values to be used for monitoring. If continuous operation is not specified the Maximum Idle Time and Pause Interval values will be ignored.
- Specify the maximum number of milliseconds the context should wait for a log file to change
before it is shut down in the Maximum Idle Time field.
Note: When the Maximum Idle Time has a value of zero and the Continuous operation
option is selected, the context will run forever until it is stopped programmatically by calling the Adapter.stop() method.
- Specify the number of milliseconds the context should wait after reaching the end of a log file before trying to read
again in the Pause Interval field.
- Specify the locale of the log file you want to parse using the ISO Language Code and the ISO Country Code fields. The ISO Language Code field
takes the lower-case, two-letter codes as specified by ISO-639.
The ISO Country Code takes the upper-case, two-letter codes as specified by ISO-3166.
The default value for the language code is en and the default value for the country code is US.
- Specify the encoding used for the log file in the Encoding field.
The encoding specified must comply with the defined charsets in the IANA Charset Registry (http://www.iana.org/assignments/character-sets).
The default value for this field is UTF-8.
Note:
- The Java VM you are using must support the locale and encoding that you are specifying.
- If no value is specified in the Encoding field, the log file will be parsed using the default
encoding of the JVM as specified in the file.encoding JVM system property.
- Specify the log file creation date and time zone offset. The year, month, and day Context properties correspond to the log file creation date. You can substitute the year, month, and day Context properties in Common Base Event records using the @YEAR, @MONTH, and @DAY parser substitution keywords, respectively. This substitution is useful when log file records do not include year, month, day, or timezone information. In the Context configuration, you only need to specify required substitution values. For example, if log file records include the day and month, you only need to specify the year and timezone Context configuration properties. For more information, see the Parser Substitute property.
- Save the adapter configuration file changes.
Parent topic: Creating
a rules-based adapter
Copyright © 2005 IBM Corporation. All rights reserved. This document
and the accompanying materials are made available under the terms of the
Eclipse Public License v1.0 which is
available at http://www.eclipse.org/legal/epl-v10.html