Configuring the sensor component for a rules-based parser
The role of the sensor is to read the log file content for processing.
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 > A single file 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.
- In the left pane, expand the sensor node. Properties associated with the
sensor are listed beneath the node.
- 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 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.
- Four optional properties that can be added are the converter,
shell, filter, and filterExitClass properties. To configure these properties:
- Select Configuration > Context Instance > A single file 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.
Parent topic: Creating
a rules-based adapter
Copyright © 2005,2006 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