Configuring the sensor component for a static adapter

Prerequisites:

The role of the sensor is to provide the means to read the content for processing. In a static parser, a property is added to the sensor to indicate that following the sensor processing, it should call a custom Java parser class. To configure the sensor:

  1. In the left pane of the Adapter Configuration Editor, select Configuration > Context Instance > Sensor. The right pane displays the sensor information.
  2. Select StaticParserSensor from the Sensor type list.
  3. In the details pane, type a description of your sensor in the Description field.
  4. In the Maximum Blocking field, type the number of Common Base Event objects that are created by the static parser sensor before they are passed to the outputter. This value indicates how many Common Base Event objects the parseNext() method of the static parser class should return. This value is passed to the static parser class as the array_size parameter by the setConfiguration() method of the static parser class.
  5. For the static adapter, the fields Confidence Buffer Size and File Footer Size do not apply to the StaticParserSensor type.
  6. The directory and fileName properties are automatically generated when the adapter configuration file is created. These correspond to the log file directory and file name. To update these properties:

    1. Select Configuration > Context Instance > Sensor > Property fileName.
    2. Edit the property value.
    3. Save the adapter configuration file to apply the changes.
    4. Repeat the same steps for the directory property.
  7. Add the parserClassName property.

    1. Select Configuration > Context Instance > Sensor.
    2. Right-click to bring up the pop-up menu.Select Add > Property. The right pane refreshes with fields to enter the property name and value.
    3. Type parserClassName as the property name and the name of your Java parser class as the property value.
    4. Save the adapter configuration file to apply the changes.
  8. You can add other properties that contain configuration information that can be passed to the static parser Java class. For example, the log file version.
  9. Since you changed the Sensor Type, you need to update the corresponding sensor component under Contexts.

    1. Select Contexts > Context Basic Context Implementation > Component OS File Sensor and select the sensor component.
    2. Update the Name and Description. Type org.eclipse.hyades.logging.adapter.config.sensors.StaticParserSensor as the Executable class.

      The sensor    component in the context is opened and the details are shown in the details pane.

    3. Save the adapter configuration file to apply the changes.

Refer to the Configuration file structure for a summary of the properties required for the sensor component of a static parser.

Once the sensor is configured, you can procced to configure the outputter component.

Related Concepts
Overview of the Hyades Generic Log Adapter
Common Base Event format specification

Related tasks
Creating a log parser
Creating a static adapter
Configuring the outputter component for static parsers

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