node-opcua-logger
node-opcua-logger copied to clipboard
InfluxDB storage as fields
I have going deeper in influxDB database (which is impressive) and I have noticed that we are storing each OPC tag as independent measurement. As I have several machines I would like to know if it would be possible to store a group of measurements as fields instead of measurements. Actually I am clasifying the measurements thanks to tag values but it would be good to have all the sensors of each machine under the same measurement "box" and treated as fields. I don't know if I have explained properly.
Thanks
I think I understand what you mean :-)
The setup is indeed to have an individual measurement per sensor / source value. You indeed give structure and group those measurements per machine using tags, as you mention. If you then want to query all data from one machine, you can use a regex query, for example:
SELECT value FROM /.*/ WHERE machine = 'machine1' AND time > now() - 5m
I interpreted this differently, and it is a use case I'm interested as well: for a machine I collect a set of data at the same timestamp: i would like to be able to save them in the same record in the same measurement, as different fields, for instance time tags1, tag2, tag3 field1 field2 field3 currently the configuration allows for multiple tag, but not for multiple fields. The polled configuration, as it reads values from opc ua at a predeterined rate could do this, while this does not make sense in the "subscribe/monitor" configuration.