Using Custom Attributes

You can create custom attributes in Log Viewer that you can use to filter your log files. Custom attributes are attributes which are created by applying a regular expression to an existing attribute. This is particularly useful for Log4J Messages which typically contain a long message containing many bits of data, unlike the attribute name/value pairs found in N2LF messages.

Procedure

  1. From Log Viewer, click Attributes.
  2. Select the view you want to load from the Load custom attributes from view drop-down list.
  3. Click Add.
    A new line is added.
  4. Click in the new line under Source Attribute and type in the source attribute you want to use. For example, messageID.
  5. Click in the new line under Expression and type in the expression you want to use. The expression is a standard Java Regular Expression, and uses the bracket notation to define a group within the expression which is extracted into the new attribute. For example, the following expression My Log Message uses value: (.*) extracts only the characters after the value ":"
  6. Click in the new line under Target Attribute and type in the name of your custom attribute. You can call this anything you want.
  7. Click in the new line under Target Attribute Type and type in the type of your custom attribute. For example, INT.
  8. Click OK or click Cancel to exit the dialog without saving your changes.
  9. You can delete a custom attribute at any time by selecting it in the Attributes dialog and clicking Delete.
  10. You can click Save view to save your current settings as a view. Enter the name of your view in the Save view dialog and click OK. The newly created view is now available for you to use in the View drop-down list.