Sample configuration files
In the extractor installation folder, the/config subfolder contains sample complete and minimal configuration files. The values wrapped in ${} are replaced with environment variables with that name. For example ${COGNITE_PROJECT} will be replaced with the value of the environment variable called COGNITE_PROJECT.
The configuration file also contains the global parameter version, which holds the version of the configuration schema used in the configuration file. This document describes version 1 of the configuration schema.
Not that it is not recommended to use the config.example.yml as a basis for configuration files. This file contains all configuration options, which is both hard to read, and may cause issues. It is intended as a reference showing how each option is configured, not as a basis. Use config.minimal.yml instead.
Minimal YAML configuration file
showLineNumbers
ProtoNodeId
You can provide an OPC UANodeId in several places in the configuration file, these are YAML objects with the following structure:
Timestamps and intervals
In most places where time intervals are required, you can use a CDF-like syntax of[N][timeunit], for example 10m for 10 minutes or 1h for 1 hour. timeunit is one of d, h, m, s, ms. You can also use a cron expression in some places.
For history start and end times you can use a similar syntax. [N][timeunit] and [N][timeunit]-ago. 1d-ago means 1 day in the past from the time history starts, and 1h means 1 hour in the future. For instance, you can use this syntax to configure the extractor to read only recent history.
History start and end times can also be set to a specific date on RFC 3339 form, like 2024-01-02T09:27:15Z, or on a shorter form like 2021-07-23+01:00. A timezone specifier is necessary, Z means UTC.
Using values from Azure Key Vault
The OPC UA extractor also supports loading values from Azure Key Vault. To load a configuration value from Azure Key Vault, use the!keyvault tag followed by the name of the secret you want to load. For example, to load the value of the my-secret-name secret in Key Vault into a password parameter, configure your extractor like this:
key-vault section in your configuration, with the following parameters:
Example:
Configure the OPC UA extractor
OPC-UA extractor configuration source
Global parameter.
alt-endpoint-urls
Part of source configuration.
List of alternative endpoint URLs the extractor can attempt when connecting to the server. Use this for non-transparent redundancy. See the OPC UA standard part 4, section 6.6.2.
We recommend setting force-restart to true. Otherwise, the extractor will reconnect to the same server each time.
Each element of this list should be a string.
endpoint-details
Part of source configuration.
Details used to override default endpoint behavior. This is used to make the client connect directly to an OPC UA endpoint, for example if the server is behind NAT (Network Address Translation), circumventing server discovery.
redundancy
Part of source configuration.
Additional configuration options related to redundant servers. The OPC UA extractor supports Cold redundancy, as described in the OPC UA standard part 4, section 6.6.2.
x509-certificate
Part of source configuration.
Specifies the configuration for using a signed x509 certificate to connect to the server. Note that this is highly server specific. The extractor uses the provided certificate to sign requests sent to the server. The server must have a mechanism to validate this signature. Typically the certificate must be provided by the server.
node-set-source
Part of source configuration.
Read from NodeSet2 files instead of browsing the OPC UA node hierarchy. This is useful for certain smaller servers, where the full node hierarchy is known before-hand. In general, it can be used to lower the load on the server.
node-sets
Part of node-set-source configuration.
List of nodesets to read. Specified by URL, file name, or both. If no name is specified, the last segment of the URL is used as file name. File name is where downloaded files are saved, and where the extractor looks for existing files.
Note that typically, you will need to define all schemas your server schema depends on. All servers should depend on the base OPC UA schema, so you should always include https://files.opcfoundation.org/schemas/UA/1.04/Opc.Ua.NodeSet2.xml
Each element of this list should be a configuration specifying a node set file.
Example:
browse-throttling
Part of source configuration.
Settings for throttling browse operations.
retries
Part of source configuration.
Specify the retry policy for requests to the OPC UA server.
retry-status-codes
Part of retries configuration.
List of additional OPC-UA status codes to retry on. In additional to defaults. Should be integer values from http://www.opcfoundation.org/UA/schemas/StatusCode.csv, or symbolic names as shown in the same .csv file.
Each element of this list should be a string.
logger
Global parameter.
Configure logging to console or file
console
Part of logger configuration.
Configuration for logging to the console.
file
Part of logger configuration.
Configuration for logging to a rotating log file.
trace-listener
Part of logger configuration.
Adds a listener that uses the configured logger to output messages from System.Diagnostics.Trace
metrics
Global parameter.
Configure logging to console or file
server
Part of metrics configuration.
Configuration for a prometheus scrape server.
push-gateways
Part of metrics configuration.
A list of push gateway destinations to push metrics to
nodes
Part of metrics configuration.
Configuration to treat OPC-UA nodes as metrics. Values will be mapped to opcua_nodes_[NODE-DISPLAY-NAME] in prometheus
other-metrics
Part of nodes configuration.
List of additional nodes to read as metrics.
cognite
Global parameter.
Configuration for pushing data to Cognite Data Fusion (CDF)
idp-authentication
Part of cognite configuration.
The idp-authentication section enables the extractor to authenticate to CDF using an external identity provider (IdP), such as Microsoft Entra ID (formerly Azure Active Directory).
See OAuth 2.0 client credentials flow
certificate
Part of idp-authentication configuration.
Authenticate with a client certificate
cdf-retries
Part of cognite configuration.
Configure automatic retries on requests to CDF.
cdf-chunking
Part of cognite configuration.
Configure chunking of data on requests to CDF. Note that increasing these may cause requests to fail due to limits in the API itself
cdf-throttling
Part of cognite configuration.
Configure the maximum number of parallel requests for different CDF resources.
sdk-logging
Part of cognite configuration.
Configure logging of requests from the SDK
extraction-pipeline
Part of cognite configuration.
Configure an associated extraction pipeline
certificates
Part of cognite configuration.
Configure special handling of SSL certificates. This should never be considered a permanent solution to certificate problems
allow-list
Part of certificates configuration.
List of certificate thumbprints to automatically accept. This is a much smaller risk than accepting all certificates
Each element of this list should be a string.
data-set
Part of cognite configuration.
Data set used for new time series, assets, events, and relationships. Existing objects will not be updated
metadata-targets
Part of cognite configuration.
Configure targets for node metadata. This configures which resources other than time series datapoints are created. By default, if this is left out, data is written to assets and time series metadata. Note that this behavior is deprecated, in the future leaving this section out will result in no metadata being written at all.
raw
Part of metadata-targets configuration.
Write metadata to the CDF staging area (Raw).
clean
Part of metadata-targets configuration.
Write metadata to CDF clean, assets, time series, and relationships.
data-models
Part of metadata-targets configuration.
ALPHA: Write metadata to ANY CDF Data Models. Please see the clean.space section of this configuration description for simplified Core Data Model Time Series support!
This will create CDF data models based on the OPC UA type hierarchy, then populate them with data from the OPC UA node hierarchy. Note that this requires extraction.relationships.enabled and extraction.relationships.hierarchical to be set to true, and there must be exactly one root node with ID i=84.
Note that this feature is in alpha there may be changes that require you to delete the data model from CDF, and breaking changes to the configuration schema. These changes will not be considered breaking changes to the extractor.
connection-target-map
Part of data-models configuration.
Target connections on the form "Type.Property": "Target". This is useful for certain schemas. This overrides the expected type of specific CDF Connections, letting you override incorrect schemas. For example, the published nodeset file for ISA-95 incorrectly states that the EquipmentClass reference for EquipmentType is an Object, while it should be an ObjectClass.
Example:
metadata-mapping
Part of cognite configuration.
Define mappings between properties in OPC UA and CDF attributes. For example, it is quite common for variables in OPC UA to have a property named EngineeringUnits, which ideally should be mapped to unit in CDF. This property lets you do that.
Example:
assets
Part of metadata-mapping configuration.
Map metadata for assets.
timeseries
Part of metadata-mapping configuration.
Map metadata for time series.
raw-node-buffer
Part of cognite configuration.
Read from CDF instead of OPC-UA when starting, to speed up start on slow servers. Requires extraction.data-types.expand-node-ids and extraction.data-types.append-internal-values to be set to true.
This should generaly be enabled along with metadata-targets.raw or with no metadata targets at all.
If browse-on-empty is set to true and metadata-targets.raw is configured with the same database and tables the extractor will read into raw on first run, then use raw as source for later runs. The Raw database can be deleted, and it will be re-created on extractor restart.
records
Part of cognite configuration.
BETA: Write events to data modeling records. Containers corresponding to OPC-UA event types will be created as needed in the configured model-space. Note that if your server produces a lot of different event types, this can create a large number of containers.
mqtt
Global parameter.
Push data to CDF one-way over MQTT. This requires that the MQTT-CDF Bridge application is running somewhere with access to CDF.
raw-metadata
Part of mqtt configuration.
Store assets/timeseries metadata and relationships in raw. Assets will not be created at all, timeseries will be created with just externalId, isStep, and isString. Both timeseries and assets will be persisted in their entirity to CDF Raw. Datapoints are not affected.
Events will be created but without being contextualized to assets. The external ID of the source node is added to metadata if applicable
metadata-mapping
Part of mqtt configuration.
Define mappings between properties in OPC UA and CDF attributes. For example, it is quite common for variables in OPC UA to have a property named EngineeringUnits, which ideally should be mapped to unit in CDF. This property lets you do that.
Example:
assets
Part of metadata-mapping configuration.
Map metadata for assets.
timeseries
Part of metadata-mapping configuration.
Map metadata for time series.
influx
Global parameter.
Configuration for pushing to an InfluxDB database. Data points and events will be pushed, but no context or metadata.
extraction
Global parameter.
Configuration for general extraction options, such as data types, mapping, and filters.
External ID generation
IDs used in OPC UA are specialnodeId objects with an identifier and a namespace that must be converted to a string before they are written to CDF. A direct conversion, however, has several potential problems.
- The namespace index is by default part of the node, but it may change between server restarts. Only the namespace itself is fixed.
- The namespace table may be modified, in which case all old node IDs are invalidated.
- Node IDs are not unique between different OPC UA servers.
- Node identifiers can be duplicated accross namespaces.
[id-prefix][namespace][identifierType]=[identifier as string](/cdf/integration/guides/extraction/configuration/[optional array index]).
For example, the node with node ID ns=1;i=123 with ID prefix gp: would be mapped to gp:http://my.namespace.url:i=123.
You can optionally override this behavior for individual nodes by using node-map(#extraction.node-map).
root-node
Part of extraction configuration.
Root node. Defaults to the Objects node
root-nodes
Part of extraction configuration.
List of root nodes. The extractor will start exploring from these. Specifying nodes connected with hierarchical references can result in some strange behavior and should be avoided
Each element of this list should be a root node.
node-map
Part of extraction configuration.
Map from external IDs to OPC UA node IDs. This can, for example, be used to place the node hierarchy as a child of a specific asset in the asset hierarchy, or to manually rename certain nodes.
Example:
proto_node_id
Part of node-map configuration.
Target node ID for mapping external ID.
namespace-map
Part of extraction configuration.
Map OPC-UA namespaces to prefixes in CDF. If not mapped, the full namespace URI is used. This saves space compared to using the full URI, and might make IDs more readable.
update
Part of extraction configuration.
Update data in destinations on re-browse or restart. Set auto-rebrowse-period to do this periodically.
objects
Part of update configuration.
Configuration for updating objects and object types.
variables
Part of update configuration.
Configuration for updating variables and variable types.
data-types
Part of extraction configuration.
Configuration related to how data types and arrays should be handled by the OPC UA extractor.
custom-numeric-types
Part of data-types configuration.
Set a list of manually defined numeric OPC UA data types. This can be used to make custom types be treated as numbers. Conversion from the actual returned values is done using the C# Convert functionality. If no valid conversion exists, this will fail.
Each element of this list should be a definition of an OPC UA data type.
node-id
Part of custom-numeric-types configuration.
Node ID of the data type
ignore-data-types
Part of data-types configuration.
List of node IDs of data types that should not be extracted to CDF. Time series with one of these data types are not extracted.
Each element of this list should be a node ID of the data type
relationships
Part of extraction configuration.
Map OPC UA references to relationships in CDF, or edges in CDF data models. Generated relationships will have external ID on the form [prefix][reference type];[source][target]
Only relationships between mapped nodes are extracted.
node-types
Part of extraction configuration.
Configuration for mapping OPC UA types to CDF in some way.
transformations
Part of extraction configuration.
A list of transformations to be applied to the source nodes before pushing. Transformations are applied sequentially, so it can help performance to put Ignore filters first, and TimeSeries filters can undo Property transformations.
Each element of this list should be an a single transformation.
Example:
filter
Part of transformations configuration.
Filter to match. All non-null filters must match each node for the transformation to be applied.
name
Part of filter configuration.
Regex or list of values matching node DisplayName.
Either one of the following options:
file
Part of name configuration.
Match field exactly from a list of values read from a local file
values
Part of name configuration.
Match field exactly from a list of values
Each element of this list should be a string.
description
Part of filter configuration.
Regex or list of values matching node Description.
Either one of the following options:
file
Part of description configuration.
Match field exactly from a list of values read from a local file
values
Part of description configuration.
Match field exactly from a list of values
Each element of this list should be a string.
id
Part of filter configuration.
Regex or list of values matching node ID. IDs on the form i=123 or s=string are matched.
Either one of the following options:
file
Part of id configuration.
Match field exactly from a list of values read from a local file
values
Part of id configuration.
Match field exactly from a list of values
Each element of this list should be a string.
namespace
Part of filter configuration.
Regex or list of values matching the full namespace of the node ID.
Either one of the following options:
file
Part of namespace configuration.
Match field exactly from a list of values read from a local file
values
Part of namespace configuration.
Match field exactly from a list of values
Each element of this list should be a string.
type-definition
Part of filter configuration.
Regex or list of values matching the node ID of the type definition. On the form i=123 or s=string.
Either one of the following options:
file
Part of type-definition configuration.
Match field exactly from a list of values read from a local file
values
Part of type-definition configuration.
Match field exactly from a list of values
Each element of this list should be a string.
deletes
Part of extraction configuration.
Configure soft deletes. When this is enabled, all read nodes are written to a state store after browse, and nodes that are missing on subsequent browses are marked as deleted from CDF, with a configurable marker. A notable exception is relationships in CDF, which has no metadata, so these are hard deleted if cognite.delete-relationships is enabled.
status-codes
Part of extraction configuration.
Configuration for ingesting status codes to CDF timeseries.
rebrowse-triggers
Part of extraction configuration.
Configuration for triggering rebrowse based on changes to specific nodes.
namespaces
Part of rebrowse-triggers configuration.
A list of namespace URIs used to filter which namespace publication data nodes the extractor will subscribe to.
Each element of this list should be a string.
events
Global parameter.
Configuration for extracting OPC UA events and alarams as CDF events or litedb time series
destination-name-map
Part of events configuration.
Map source browse names to other values in the destination. For CDF, internal properties may be overwritten. By default Message is mapped to description, SourceNode is used to set the assetIds, and EventType is mapped to type. These may be replaced by overrides in destination-name-map.
If StartTime, EndTime, or SubType are specified, either on the event in OPC-UA itself, or translated through this map, they are set directly on the CDF event. StartTime and EndTime should be either DateTime, or a number corresponding to the number of milliseconds since 01/01/1970. If no StartTime or EndTime are specified, both are set to the Time property.
Example:
event-ids
Part of events configuration.
Allow-list of event type IDs to map. If this is included, only the events with type equal to one of these node IDs will be included.
Each element of this list should be a node ID of the data type
emitter-ids
Part of events configuration.
List of event emitters to extract from. The default behavior is to extract events from nodes based on the EventNotifier attribute. This option ignores EventNotifier and extracts events from the given list of nodes.
Each element of this list should be a node ID of the data type
historizing-emitter-ids
Part of events configuration.
List of node IDs that must be a subset of the emitter-ids property. These emitters will have their event history read. The server must support historical events. The events.history property must be true for this to work.
Each element of this list should be a node ID of the data type
exclude-properties
Part of events configuration.
List of BrowseNames of event properties that are to be excluded from automatic mapping to destination metadata. By default, LocalTime and ReceiveTime are excluded. Be aware that a maximum of 16 metadata entries are allowed in CDF.
Each element of this list should be a string.
failure-buffer
Global parameter.
If the connection to CDF goes down, the OPC UA extractor supports buffering data points and events in a local file or InfluxDB. This is helpful if the connection is unstable, and the server does not provide its own historical data.
history
Global parameter.
Configuration for reading historical datapoints and events from the server
throttling
Part of history configuration.
Configuration for throttling history
state-storage
Global parameter.
A local LiteDB database or a database in CDF RAW that store various persistent information between extractor runs. This is used to replace reading first/last data points from CDF, and also allows storing first/last times for events.
Enabling this is highly recommended, and will be required in a future version of the extractor.
subscriptions
Global parameter.
A few options for subscriptions to events and data points. Subscriptions in OPC UA consist of Subscription objects on the server, which contain a list of MonitoredItems. By default, the extractor produces a maximum of four subscriptions:
- DataChangeListener - handles data point subscriptions.
- EventListener - handles event subscriptions.
- AuditListener - which handles audit events.
- NodeMetrics - which handles subscriptions for use as metrics.
data-change-filter
Part of subscriptions configuration.
Modify the DataChangeFilter used for datapoint subscriptions. See the OPC UA reference part 4 7.17.2 for details. These are just passed to the server, they have no further effect on extractor behavior. Filters are applied to all nodes, but deadband should only affect some, according to the standard.
alternative-configs
Part of subscriptions configuration.
List of alternative subscription configurations. The first entry with a matching filter will be used for each node.
Each element of this list should be an alternative subscription configuration
filter
Part of alternative-configs configuration.
Filter on node, if this matches or is null, the config will be applied.
data-change-filter
Part of alternative-configs configuration.
Modify the DataChangeFilter used for datapoint subscriptions. See the OPC UA reference part 4 7.17.2 for details. These are just passed to the server, they have no further effect on extractor behavior. Filters are applied to all nodes, but deadband should only affect some, according to the standard.
pub-sub
Global parameter.
Configure the extractor to read from MQTT using OPC-UA pubsub. This requires the server pubsub configuration to be exposed through the Server object. You should consider setting subscriptions: data-points: false to avoid duplicate datapoints if this is enabled.
high-availability
Global parameter.
Configuration to allow you to run multiple redundant extractors. Each extractor needs a unique index.
raw
Part of high-availability configuration.
Configuration to use Raw as backend for high availability
redis
Part of high-availability configuration.
Configuration to use a Redis store as backend for high availability