Measurement settings

The Measurement Settings section configures how CSV data is interpreted and mapped into measurements. This includes defining how each column in the CSV file is used, setting up filters for data inclusion, and specifying data quality indicators.

Measurement settings

ValueColumn

Description: Column of the value in the csv file for this measurement.
Required: yes
Example: 6

Filter

Description: Filter to parse only the rows that match the filter. The filter is a JSON object where the key is the column index (as a string) and the value is an exact value to match. To match against a set of exact values, separate them with a semicolon. To use the value as a regular expression, set FilterByRegularExpression to true. Backslashes in regulars expressions need to be escaped with another backslash. Use {} to leave empty.
Required: yes
Details:

  • Key: CSV column index as a string.
  • Value: Names used for mapping, separated by semicolons if multiple.

Example:
In the following example (with FilterByRegularExpression set to false), the filter will only parse rows where the value of the first column is Example value and the value of the second column is match with this or also match with this.

1
2
3
4
{
  "0": "Example value",
  "1": "match with this;also match with this"
}

In the following example (with FilterByRegularExpression set to true), the filter will only parse rows where the value of the first column contains Example and the value of the second column is match with this or also match with this.

1
2
3
4
{
  "0": "Example",
  "1": "^(match with this|also match with this)$"
}

FilterByRegularExpression

Description: If true, values in Filter will be treated as a regular expression. If false, values in Filter will be treated as a (list of) value to match. Default is false.
Required: no

StatusGood

Description: All values that are mapped to status ‘Good’. Multiple statuses can be configured using semicolon separated values.
Required: no
Example: “Valid;correct”

Checkout the data collection methods section for more information.

TimestampLayout

Description: The layout of the timestamp, defaults to the TimestampLayout setting on the collector. More info: https://pkg.go.dev/time#Layout
Required: no

TagsInCSV

Description:This allows to add tags to the measurement with the tag value coming from csv data. The structure of this setting is similar as the Filter setting. The json key is the column index (as string) where the tag value is present, and the json value is the tag key (or tag name) under which the data should be stored upon the measurement:
Required: no
Example:{"4": "Description"}

Locale

Description: The locale with which numbers should be parsed. Default is the value of the corresponding setting on the collector.
Required: no

This table lists some examples of number formats and the locale with which they can be correctly parsed to a number the collector can process.
The output in these examples is always the same: 1234.56

input locale
1 234.56 en-GB
1,234.56 en-US
1.234,56 de-DE
1 234,56 fr-FR
1234,56 nl-BE

Examples

Example 1

This example demonstrates setting up a collector and measurement for a CSV with multiple sensor data.

Given the following CSV format, with files being provided by a data source located in Europe/Brussels.

Time,Name,Value,Unit,Quality
"1/12/2023 13:00:01.868",P99,"0.00",,Good
"1/12/2023 13:01:01.876",P99,"0.00",,Good
"1/12/2023 13:02:01.863",P99,"100.00",,Good
"1/12/2023 13:03:01.840",P99,"100.00",,Good
"1/12/2023 13:00:01.868",TT100,"27.51",,Good
"1/12/2023 13:01:01.876",TT100,"26.04",,Good
"1/12/2023 13:02:01.863",TT100,"25.97.00",,Good
"1/12/2023 13:03:01.840",TT100,"26.23",,Good

Collector Settings

Setting Value
Delimiter ,
CSVHeader true
TimestampColumn 0
TimestampLayout 2/01/2006 15:04:05.000
StatusColumn 4
TrimString No Value
Advanced Setting Value
SourceTimezone Europe/Brussels

Measurement Settings

Setting Value
Name Area_Pump99
ValueColumn 2
Filter { “1”: “P99” }
StatusGood Good
TagsInCSV {}
TimestampLayout No Value
Setting Value
Name Area_Temperature100
ValueColumn 2
Filter { “1”: “TT100” }
StatusGood Good
TagsInCSV {}
TimestampLayout No Value