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 Platform 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.
Set the
opsmanager_syslog
property totrue
in yourmetadata.yml
. For more information, see opsmanager_syslog.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 asproperties
. 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.
Save the JavaScript file to the
PRODUCT/migrations/v1
directory of your.pivotal
file.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.
- From your product template,
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.
Update the description for the deprecated properties to state that they are deprecated and are no longer used to configure the syslog.
Run a test deploy of your tile by doing the procedures in Testing Tiles.
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 thesyslog_configuration
API endpoint, see Retrieving syslog configuration for a product.
Note: In the next version of your product, remove the deprecated syslog configuration properties.