This is an old revision of the document!


Configuring Live Data Distribution

To distribute live data to other locations, create a replication.json file in your site folder.

The site folder is located in your ARDI installation directory, under /web/sites/.

This file should contain JSON data similar to the example below…

[
	{
		"type": "mqttob",
		"config": {
			"hostname": "localhost",
			"topic": "/data/ardi"
		},
		"ern": false,
		"fullpath": true,
                "filter": "*"
	}
]

This tells the system to push all incoming data out MQTT via a server running on the local machine (localhost), under the '/data/ardi' topic.

Type

The type of the distribution tells the system where to send the information. In this example, it's MQTTOB, which is the object-based version of MQTT.

There are a variety of options available, and these can be extended via Python.

Config

The config section is unique to each of the different types. They'll include information such as which specific server/destination to send the information to, usernames, passwords etc.

Filter

This determines which points are distributed. You can either leave this blank (or '*') to replicate all points of data, or you can use a semi-colon delimited list of names of the data sources you want to replicate.

For example, if you only wanted to record information from the assets called 'EMS' and 'Waste Monitoring System', you'd use…

{
   "filter": "EMS;Waste Monitoring System"
}
 
===Naming and Formatting===
 
The remaining parameters mostly focus on controlling the final names of the points that are written to the system.
 
By default, the name will be the ARDI asset name, a period (.) and the ARDI property name.
 
For example...
 
==fullpath==
 
The **fullpath** setting lets you use the full ARDI location path for the assets as their name. For example, 'Main Site/Water System/Main Water Tank' instead of just 'Main Water Tank'.
 
If this value is //true//, a backslash is used to split the parts of the name. If this is a character (ie, '-' or ':'), that character is used to split the various components. Ie. 'Main Site:Water System:Main Water Tank'.
 
==trimfirst==
 
Trims the first 'x' characters from the final name.
 
This is often used along-side **fullpath** to trim the leading object(s) from a complex path.
 
==ern==
 
Uses the ERN or another field value as the name, where available.
 
If //true//, the system finds the ERN property. If anything else other than //false//, the system searches for a property with the name and uses the value of that property (if available) instead of the assets name.
 
==friendly==
 
Turns on //friendly// naming for ARDI-style complex properties. For example, converts 'Temperature - Oven' to 'Oven Temperature'.
 
===replace===
 
Contains an array of options that are search-and-replaced in the name.
 
For instance, a destination that doesn't support spaces in names might have the following...
 
<code javascript>
{ 
    "replace": {
          " ": ""
          "-": "_"
     }

Or if you wanted to rename specific property names from final results, you could…

{
     "replace": {
          "Temperature - Target": "Target"
     }