Using values from environment variables
The configuration file allows substitutions with environment variables. For example:COGNITE_CLIENT_SECRET environment variable into the cognite/secret parameter. You can also do string interpolation with environment variables, for example:
Implicit substitutions only work for unquoted value strings. For quoted strings, use the
!env tag to activate environment substitution:Using values from Azure Key Vault
The DB 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:
azure-keyvault section in your configuration, with the following parameters:
Example:
Base configuration object
cognite
Global parameter.
The cognite section describes which CDF project the extractor will load data into and how to connect to the project.
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).
scopes
Part of idp-authentication configuration.
Enter a list of scopes requested for the token
Each element of this list should be a string.
certificate
Part of idp-authentication configuration.
Authenticate with a client certificate
data-set
Part of cognite configuration.
Enter a data set the extractor should write data into
extraction-pipeline
Part of cognite configuration.
Enter the extraction pipeline used for remote config and reporting statuses
connection
Part of cognite configuration.
Configure network connection details
proxies
Part of connection configuration.
Dictionary mapping from protocol to url.
logger
Global parameter.
The optional logger section sets up logging to a console and files.
console
Part of logger configuration.
Include the console section to enable logging to a standard output, such as a terminal window.
file
Part of logger configuration.
Include the file section to enable logging to a file. The files are rotated daily.
metrics
Global parameter.
The metrics section describes where to send metrics on extractor performance for remote monitoring of the extractor. We recommend sending metrics to a Prometheus pushgateway, but you can also send metrics as time series in the CDF project.
push-gateways
Part of metrics configuration.
List of prometheus pushgateway configurations
Each element of this list should be a the push-gateways sections contain a list of metric destinations.
cognite
Part of metrics configuration.
Push metrics to CDF timeseries. Requires CDF credentials to be configured
data-set
Part of cognite configuration.
Data set the metrics will be created under
server
Part of metrics configuration.
The extractor can also be configured to expose a HTTP server with prometheus metrics for scraping
queries
Global parameter.
List of queries to execute
Each element of this list should be a description of a SQL query against a database
destination
Part of queries configuration.
The destination of the data in CDF.
Either one of the following options:
Examples:
raw
Part of destination configuration.
The raw destination writes data to the CDF staging area (RAW). The raw destination requires the primary-key parameter in the query configuration.
events
Part of destination configuration.
The events destination inserts the resulting data as CDF events. The events destination is configured by setting the type parameter to events. No other parameters are required.
To ingest data into a events, the query must produce columns named
externalId
startTimeendTimedescriptionsourcetypesubType
metadata field for events.
assets
Part of destination configuration.
The assets destination inserts the resulting data as CDF assets. The assets destination is configured by setting the type parameter to assets. No other parameters are required.
To ingest data into a assets, the query must produce columns named
name
externalIdparentExternalIddescriptionsource
metadata field for assets.
time_series
Part of destination configuration.
The time_series destination inserts the resulting data as data points in time series. The time series destination is configured by setting the type parameter to time_series. No other parameters are required.
To ingest data into a time series, the query must produce columns named
externalIdtimestampvalue
status to give the datapoint a status code. Statuses include a category, and an optional comma-separated list of modifyer flags. Some examples for status codes include Good (which is assumed if status is omitted), UNCERTAIN, HIGH and bad.
The extractor will insert data points into time series identified by the externalId column. If a time series does not exist, the extractor will create a minimal time series with only an external ID and the isString property inferred from the type of first data point processed for that time series. All other time series attributes need to be added separately.
data-model
Part of time_series configuration.
Defines Data Model mapping information, including the target Space and Data Model. This property is only applicable when the destination type is set to timeseries.
sequence
Part of destination configuration.
The sequence destination writes data to a CDF sequence.
The column set of the query result will determine the columns of the sequence.
The result must include a column named row_number, which must include an integer indicating which row number in the sequence to ingest the row into.
files
Part of destination configuration.
The files destination inserts the resulting data as CDF files. The files destination is configured by setting the type parameter to files. No other parameters are required.
To ingest data into a files, the query must produce columns named
nameexternalIdcontent
content will be treated as binary data and uploaded to CDF files as the content of the file
In addition, columns named
sourcemimeTypedirectorysourceCreatedTimesourceModifiedTimeasset_ids
metadata field for files.
data-model
Part of files configuration.
Defines Data Model mapping information, including the target Space and Data Model. This property is only applicable when the destination type is set to files.
nodes
Part of destination configuration.
The nodes destination inserts the resulting data into nodes containers. The nodes destination is configured by setting the type parameter to nodes. You have to add data-model.
To ingest data into a nodes, the query must produce columns named
externalId
view
Part of nodes configuration.
Enter the CDF view/container configuration. This is required to write to nodes.
edges
Part of destination configuration.
The edges destination inserts the resulting data into edges containers. The edges destination is configured by setting the type parameter to edges. You have to add data-model.
To ingest data into a edges, the query must produce columns named
externalIdstartNodeExternalIdstartNodeSpaceendNodeExternalIdendNodeSpacetypeExternalIdtypeSpace
view
Part of edges configuration.
Enter the CDF view/container configuration. This is required to write to edges.
schedule
Part of queries configuration.
Enter the schedule for when this query should run. Make sure not to schedule runs too often, but leave some room for the previous execution to be done. Required when running in continuous mode, ignored otherwise.
Either one of the following options:
Examples:
fixed_interval
Part of schedule configuration.
cron_expression
Part of schedule configuration.
databases
Global parameter.
List of databases to connect to
Each element of this list should be a configuration for a database the extractor will connect to
Either one of the following options:
- ODBC
- PostgreSQL
- Oracle DB
- Snowflake
- MongoDB
- Azure Cosmos DB
- Local spreadsheet files
- Amazon Dynamo DB
- Amazon Redshift
- Google BigQuery
odbc
Part of databases configuration.
Open Database Connectivity (ODBC) is a generic protocol for querying databases. To connect to a database using ODBC, you must first download and install an ODBC driver for your database system on the machine running the extractor. Consult the documentation or contact the vendor of your database system to find its driver.
Example:
source
Part of odbc configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
postgresql
Part of databases configuration.
Example:
source
Part of postgresql configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
oracle_db
Part of databases configuration.
The Cognite DB Extractor can connect directly to an Oracle Database version 12.1 or later.
Example:
source
Part of oracle_db configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
snowflake
Part of databases configuration.
private_key
Part of snowflake configuration.
Private key for Snowflake. Include to make use of private-key Authentication.
source
Part of snowflake configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
mongodb
Part of databases configuration.
source
Part of mongodb configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
azure_cosmos_db
Part of databases configuration.
source
Part of azure_cosmos_db configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
local_spreadsheet_files
Part of databases configuration.
The Cognite DB extractor can run against excel spreadsheets and other files containting tabular data. The currently supported file types are
- xlsx, xlsm and xlsb (modern Excel files)
- xls (legacy excel files)
- odf, ods and odt (OpenDocument Format, used by e.g. Libre Office and Open Office)
- csv (Comma separated values)
sheet parameter in the associated query configuration.
source
Part of local_spreadsheet_files configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
amazon_dynamo_db
Part of databases configuration.
source
Part of amazon_dynamo_db configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
amazon_redshift
Part of databases configuration.
source
Part of amazon_redshift configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
google_bigquery
Part of databases configuration.
The Cognite DB Extractor can run against Google BigQuery using Google SQL(like) query.
Because this extends the Google SDK, you also authenticate with the Google suggested authentication methods by setting the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your authentication key
source
Part of google_bigquery configuration.
Represents the system from which the data originates, including identifying information such as the name and a unique external identifier.
extractor
Global parameter.
General extractor configuration
state-store
Part of extractor configuration.
Include the state store section to save extraction states between runs. Use this if data is loaded incrementally. We support multiple state stores, but you can only configure one at a time.
raw
Part of state-store configuration.
A RAW state store stores the extraction state in a table in CDF RAW.
local
Part of state-store configuration.
A local state store stores the extraction state in a JSON file on the local machine.