Configuring the sensor component for a rules-based parser

The role of the sensor is to read the log content for processing.

Prerequisites:

To configure the sensor for a rules-based parser, follow these steps:

  1. In the left pane of the Adapter Configuration Editor, select Configuration > Context Instance > Sensor. The right pane displays the sensor information.
  2. In the Sensor type list, select the SingleFileSensor.
  3. Type a description of your sensor in the Description field.
  4. In the Maximum Blocking field, type the number of lines you want the sensor to process before passing the information to the extractor.
  5. Some log files append a footer to the end of the log file. This part of the log file is not considered log data, and needs to be excluded when monitoring a log file for changes. You can specify the log file footer size in bytes in the File Footer Size field. The default size is 90 bytes.
  6. If a log file is being monitored in continuous operation, the last n bytes of the log file is stored in memory. This stored data, called a confidence buffer, is compared to the last n bytes of the log file being monitored to check whether or not the log file has changed. You can specify the size of the confidence buffer in the Confidence Buffer Size field. The default size is 1024 bytes.
  7. The directory property allows you to specify the name of the directory where the application log file is located. To update the value of the property, follow these steps:
    1. Select Configuration > Context Instance > Sensor > Property directory.
    2. Edit the property value.
    3. Save the adapter configuration file to apply the changes.
  8. The fileName property allows you to specify the name of the application log file. If the application generating the log file uses log file rotation, you can specify the log file name using regular expressions. For example, an application generates the following log files in rotation
    myapp.log
    myapp_1.log
    myapp_2.log
    . The file name can be specified as myapp(_\d)?.log. The sensor will read all files that match that pattern as a single file.
  9. Two optional properties that can be added are the converter and shell properties. To configure these properties:
    1. Select Configuration > Context Instance > Sensor.
    2. Right-click on the sensor 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 the name and value of the property.
    4. Save the adapter configuration file to apply the changes.
    Refer to the Sensor properties table for an explanation of the properties required for the sensor component of a rule-based parser.
  10. To test that your log file is being loaded by the sensor, click the Re-run adapter  Picture of the Rerun adapter icon icon to run the adapter.
  11. Click Show Log Picture of the Showlog adapter icon to display the results in the Sensor Results view.

Once the sensor is configured, you can continue on to configure the extractor component.

Related concepts
Overview of the Hyades Generic Log Adapter

Related tasks
Configuring the extractor component

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