Collectors and data formats
Data Formats
JSON Settings
either the mqtt collector docid\ ggnqijhlxifoimbt yp2c or the rest api collector docid\ sybxzdwwtncpai2hqdusc can be configured to read values from {{json}} collector settings ignorejsonpatherrors description the ignorejsonpatherrors setting determines whether errors in jsonpath expressions should be logged or not use ignorejsonpatherrors = false if your json structure should always contain specific fields, and you want to log missing or malformed jsonpath expressions use ignorejsonpatherrors = true if your json format is dynamic and you expect some fields to be missing errors resulting from missing paths or invalid expressions are ignored required no default false measurement settings the measurement settings reflect the configuration possibilities for mapping a json message the values are extracted from the messages using jsonpath jsonpath documentation can be found here , jsonpath com is a useful tool to test jsonpath expressions the path expressions can either yield a single value, or a list of values the expressions for the timestamp(s), status(es), and tags and values have to either yield the same amount of results as the expression for the measurement(s), or only a single value, in which case that single value will be used for all found measurements topic description the topic to listen to when the topic is specified here, it will override the topic that was set in the collector required no collectiontype description the way this measurement should be collected from the opc ua server required no default raw options raw raw measurements collect all points as they are received from the mqtt broker no filtering is applied to them whatsoever downsampled for downsampled measurements, the downsamplinginterval setting indicates how much time needs to have passed since the last datapoint before the next one is written if less time has passed, the new point is ignored if more time has passed, the point is collected and its timestamp becomes the new reference time to which new points are compared no filtering is applied to points with quality other than good monitoring monitored measurements collect data on every change of the measurements value incoming points are ignored if their value is equal to that of the last point before it typically, monitored measurements are configured for boolean or string data types that indicate an equipments state, f e for a valve that opens and/or closes only a few times per hour no filtering is applied to points with quality other than good downsamplinginterval description the minimum interval between points (only used for collectiontype downsampled) required no default 0 measurementpath description the json path that leads to a value, or a list of values in the message required yes timestamppath description the jsonpath that leads to a timestamp, or a list of timestamps in the message required no if empty the collector's timestamp will be assigned to data points statuspath description the json path that leads to a status, or a list of statuses in the message if not set, status will default to ‘good’ required no tagnamesandtagvaluepaths description map describing tags, where keys are the tag names, and the values are the json paths of the tag values required no timestamplayout description a timestamp layout is used to correctly interpret the resulting timestamp(s) from the timestamppath a list of available timestamp formats, along with their string representations, can be found in the golang time package documentation required no if empty the default rfc3339 timestamplayout e g 2006 01 02t15 04 05z07 00 is used for timestamps in unix format, one of the following values can be used unix (time in s), unixmillis (time in ms), unixmicros (time in μs), or unixnanos (time in ns) for other timestamp formats, see the read data from json docid\ rkukkrd4ariwfqk96lqy5 below warning the measurement timestamplayout setting overrides the collector's timestamplayout setting timestamp layout examples timestamp in json message timestamplayout 2024 03 31t14 30 00z 2006 01 02t15 04 05z07 00 2024 03 31t14 30 00+02 00 2006 01 02t15 04 05z07 00 1711895400 unix 1711895400123 unixmillis custom timestamp layout examples timestamp in json message timestamplayout 31 03 2024 14 30 00 123 02 01 2006 15 04 05 000 sunday, 31 mar 2024 14 30 00 utc monday, 02 jan 2006 15 04 05 mst custom timestamp layouts allow flexibility for different timestamp representations you can define them according to your needs using go’s time layout reference here important if your timestamps use a different structure, make sure to adjust the timestamp layout accordingly