Configuring the adapter Contexts 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.

Prerequisites:
Create an Adapter Configuration File

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:

  1. 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.
  2. Update the Executable class with one of the available context implementations. See the Adapter Configuration File structure for a list of valid classes.
  3. Update other fields of the context as required.
  4. 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:

  1. In the left pane of the Adapter Configuration Editor, expand the Configuration node. Select Context Instance. The right pane displays the Context Instance information.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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:
    1. The Java VM you are using must support the locale and encoding that you are specifying.
    2. If no value is specified in the Encoding field, the log file will be parsed using the default encoding of the JVM as specifed in the file.encoding JVM system property.
    3. Save the adapter configuration file changes.

Changes in the adapter configuration file are saved in the plug-in project you created. For details of the adapter configuration file structure, please see the related reference topics. Once the adapter context is configured, continue to configure the sensor component.

 

Related concepts
Overview of the Hyades Generic Log Adapter

Related tasks
Configuring the sensor component

Related references
Adapter Configuration File structure
Adapter Configuration Editor
Regular expression grammar