Skip to main content
Version: 2.7

InfluxDB Publisher Configuration

Each logger instance has its own configuration, multiple loggers can be configured and executed at the same time.

The logger specific connection string must be set in the property "Connection". Example: http://mydb.com:8086/api/v2/write?bucket=humanos&orgID=880d77f7f6649211&rp=

Add additional Properties to the publisher. Use CustomHeader:<HeaderName> to specify special properties for HTTP/HTTPS communications, such as Authorization.

The following table contains the specific properties of the InfluxDbLogger Publisher configuration. It extends the general DataLogger publisher configuration documented in Common DataLogger Configuration.

ParameterDescriptionData Type
PrecisionPrecision of the data logger
  • ns: nanoseconds
  • us: microseconds
  • ms: milliseconds
  • s: seconds (only supported by Influx 1.x)
  • m: minutes (only supported by Influx 1.x)
  • h: hours (only supported by Influx 1.x)
System.String

Connection Parameter

The Connection parameter contains the write-URL without the “precision”-query.

Example Influx 1.x:

http://10.196.24.12:8086/write?db=test&rp=

Example Influx 2.x:

http://10.241.0.14:8086/api/v2/write?bucket=HumanOS&orgID=83720f1029&rp=

Authentication

The authentication changed from version 1.x to 2.x.

  • 1.x: The username and password must be specified in the “Connection” setting
    http://10.196.24.12:8086/write?db=test&rp=&u=username&p=password

  • 2.x: The authentication can be realized using an API token in the header (CustomHeader:Authentication property of the publisher)

Influx Line Protocol

The DataSet-element specifies the elements of the Influx line protocol (measurement, tags, fields and timestamp).

// Syntax

<measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]]
<field_key>=<field_value>[,<field_key>=<field_value>]
[<timestamp>]
// Example

myMeasurement,tag1=value1,tag2=value2 fieldKey="fieldValue"
1556813561098000000

Accordingly, the dataset contains following log-fields, that must match to the protocol elements:

FieldNameDescriptionData Type
MeasurementField contains the name of the measurementSystem.String
StateField contains the data stateSystem.Type
Tag:<key>[Optional] Field contains a tag-key and valueSystem.String
Field:<key>Field contains a field-key and its valueSystem.Object
TimeStamp[Optional] Field contains the timestamp of the data node. If not set, it will take to current timestamp of data processingSystem.DateTime

Further information about DataSets can be found in the manual Common DataLogger Configuration.

INFORMATION

Note, that multiple tags can be specified. Use tags to optimize the queries in InfluxDB.

INFORMATION

If a tag value is empty, the tag is not reported to InfluxDB.

Caution

Measurement names, tag-keys, and field-keys cannot begin with an underscore _. The _ namespace is reserved for InfluxDB system use.

Example:

The example uses the Guid of the data node as measurement and the node name as tag-key. The value of data node is mapped to the influx field-value.

{
"Disable": false,
"Publishers": [
{
"Id": "608BB9CC-29A3-4F35-9439-6B132207BFE1",
"Name": "TestDataLogger20",
"Connection": "http://10.241.0.14:8086/api/v2/write?bucket=HumanOS&orgID=990d66f7556400fb&rp=",
"Precision": "ms",
"NetworkTimeout": 10000,
"Properties": {
"CustomHeader:Authorization": "Token I83k382JSMAu3jdmsm-oweowe932o23092721-pgoq8uAQfqp8s=="
},
"DataSets": [
{
"Name": "test2",
"Type": "DataNode",
"NodeFilter": "",
"Tag": "test",
"Fields": [
{
"Name": "Measurement",
"DataType": "System.String",
"Query": "item.GlobalId"
},
{
"Name": "Tag:Name",
"DataType": "System.String",
"Query": "item.Node.Name"
},
{
"Name": "TimeStamp",
"DataType": "System.DateTime",
"Query": "item.TimeStamp"
},
{
"Name": "Field:Value",
"DataType": "System.Object",
"Query": "item.Value"
},
{
"Name": "State",
"DataType": "System.Int32",
"Query": "item.DataState"
}
]
}
],
"ServiceRule": {
"BindingRuleId": "{8A80927A-B1F8-4505-B4BA-FB2DFED765E4}",
"UnbindingRuleId": "{1058566D-0787-48C3-95A5-235E9A55CCF3}",
"Type": "All"
}
}
]
}

Mapping of HumanOS® DataTypes

HumanOS® supports much more data types than InfluxDB.

DataTypeMapping
System.BooleanMaps to the Boolean of Influx (True or False)
System.SByte; System.Int16; System.Int32; System.Int64Maps to the Integer data type of Influx (64bit)
System.Byte; System.UInt16; System.UInt32; System.UInt64Maps to UInteger of Influx (64bit)
System.Double; System.Single; System.DecimalMaps to IEEE-754 64-bit floating-point numbers.
ArraysMaps to a string. Elements are separated by “;”
Everything elseMaps to string.