Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Configuration

Dj Walker-Morgan edited this page Mar 27, 2017 · 2 revisions

The Transporter has one file which contains all its configuration settings, pipeline.js. This is an example pipeline.js generated by running the transporter init mongodb elasticsearch commands.

var source = mongodb({
  "uri": "${MONGODB_URI}"
  // "timeout": "30s",
  // "tail": false,
  // "ssl": false,
  // "cacerts": ["/path/to/cert.pem"],
  // "wc": 1,
  // "fsync": false,
  // "bulk": false,
  // "collection_filters": "{}"
})

var sink = elasticsearch({
  "uri": "${ELASTICSEARCH_URI}"
  // "timeout": "10s", // defaults to 30s
  // "aws_access_key": "ABCDEF", // used for signing requests to AWS Elasticsearch service
  // "aws_access_secret": "ABCDEF" // used for signing requests to AWS Elasticsearch service
})

t.Source(source).Save(sink)
// t.Source("source", source).Save("sink", sink)
// t.Source("source", source, "/.*/").Save("sink", sink, "/.*/")

The node definitions

The nodes are defined as JavaScript objects and assigned to variables which, in this case, are named source and sink. They can be assigned to any legal JavaScript variable name. Each node object is created using constructor with the same name as the adaptor they will represent. Here mongodb(...) and elasticsearch(...). All parameters to these adaptors are passed over in a JavaScript object. A required parameter, uri, is set which is used to locate the database for reading or writing. Any field can include a reference to an environment variable in the form of ${ENVVAR}. Use transporter about adaptername at the command line to get a list of current parameters for that adapter.

Note: When uncommenting parameters in the variable settings, remember to add commas where needed.