Migrating Existing Syslog Configuration to Ops Manager

Page last updated:

This topic explains how to migrate existing syslog properties that are defined by a tile into the syslog form provided by Ops Manager in Pivotal Cloud Foundry (PCF) v2.5 and later.

By enabling the Ops Manager syslog feature, Ops Manager:

  • Provides your tile with its own syslog form
  • Ensures that the syslog BOSH release is automatically injected into the instance groups of your product
  • Includes syslog configuration properties when Ops Manager injects the syslog release into your product

Syslog Data Model

The following table lists the Ops Manager syslog parameters that you can migrate your existing configurations to.

Syslog parameter Data Type Required Notes
enabled boolean No Defaults to false
address string Yes The address or host for the syslog server.
Must be a valid network address
port integer Yes The port on which the syslog server listens
transport_protocol string No The transport protocol used to send syslog messages to the server.
Valid values are tcp and udp. Defaults to tcp
tls_enabled boolean No Send logs encrypted to syslog server via TLS. Defaults to false
permitted_peer boolean No, unless tls_enabled is true Defaults to false.
ssl_ca_certificate string No, unless tls_enabled is true Must be a valid certificate
Defaults to null.
queue_size integer No The number of log messages the buffer holds before dropping messages. A larger buffer size might overload the system. Defaults to 100000
forward_debug_logs boolean No Defaults to false
custom_rsyslog_configuration text No Additional configuration for rsyslog written in the rainerscript syntax. For example, if ($app-name startswith "exampleComponent") then stop can be used to drop all traffic from a particular component. The entered configuration is applied before the forwarding rule.

Use the JavaScript Migration Process

Tile authors can write a JavaScript migration to move their existing syslog properties into the syslog form provided by Ops Manager. After a successful migration, Ops Manager presents the migrated syslog properties in the Syslog form of the tile.

  1. Set the opsmanager_syslog property to true in your metadata.yml. For more information, see opsmanager_syslog.

  2. To write your JavaScript migration, use the following example as a template:

    exports.migrate = function(input) {
      input.syslog_configuration = {
        enabled: true,
        address: input.properties['.PROPERTY-REFERENCE.EXAMPLE-ADDRESS'],
        port: input.properties['.PROPERTY-REFERENCE.EXAMPLE-PORT'],
        transport_protocol: input.properties['.PROPERTY-REFERENCE.EXAMPLE-PROTOCOL']
      };
      return input;
    };
    

    In the code block above, replace the example text as follows:

    • PROPERTY-REFERENCE: Replace with the property reference that corresponds to the metadata file, such as properties. For more information about migrating properties, see Tile Upgrades.
    • EXAMPLE-ADDRESS: Replace with the property name of the address.
    • EXAMPLE-PORT: Replace with the property name of the port.
    • EXAMPLE-PROTOCOL: Replace with the property name of the transport protocol.
  3. Save the JavaScript file to the PRODUCT/migrations/v1 directory of your .pivotal file.

  4. Remove the following:

    • From your product template, form_types that allow operators to configure tile-specific syslog configuration
    • From your tile, the syslog BOSH release.
    • From your deployment manifest, syslog configuration properties.
  5. To ensure that operators do not try to update syslog configuration properties with no outward functionality, mark all existing syslog configuration properties in your product as non-configurable.

  6. Update the description for the deprecated properties to state that they are deprecated and are no longer used to configure the syslog.

  7. Run a test deploy of your tile by doing the procedures in Testing Tiles.

  8. To ensure that your syslog properties were successfully migrated into the Ops Manager syslog configuration, do one of the following:

    • View the configurations in the Syslog pane in Ops Manager Settings page.
    • View your syslog properties using the syslog_configuration Ops Manager API endpoint. For more information about the syslog_configuration API endpoint, see Retrieving syslog configuration for a product.

Note: In the next version of your product, remove the deprecated syslog configuration properties.