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:
- In the left pane of the Adapter Configuration Editor, select Configuration > Context Instance > Sensor.
The right pane displays the sensor information.
- In the Sensor type list, select the SingleFileSensor.
- Type a description of your sensor in the Description field.
- In the Maximum Blocking field, type the number of
lines you want the sensor to process before passing the
information to the extractor.
- 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.
- 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.
- 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:
- Select Configuration > Context Instance > Sensor > Property directory.
- Edit the property value.
- Save the adapter configuration file to apply the changes.
- 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.
- Two optional properties that can be added are the converter
and shell properties. To configure these properties:
- Select Configuration > Context Instance > Sensor.
- 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.
- Type the name and value of the property.
- 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.
- To test that your log file is being loaded by the sensor, click the Re-run adapter
icon to run the adapter.
- Click Show Log
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
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.