Compare commits

...

3 Commits

Author SHA1 Message Date
38fed9604c Merge branch 'release-2.0' into dev 2021-12-06 13:42:37 +01:00
94846a48e1 Fix data-fields not getting added as tags 2021-12-06 13:32:21 +01:00
f00db16269 Merge branch 'dev' into release-2.0 2021-12-06 13:11:02 +01:00

View File

@ -4,12 +4,12 @@ const {Point} = require("@influxdata/influxdb-client");
/** Keys to always use as tags */ /** Keys to always use as tags */
const TAG_LIST = [ const TAG_LIST = [
"srcmac", "srcMac",
"dstmac", "dstMac",
"bssid", "bssid",
"frequency", "frequency",
"flags", "flags",
"packettype", "packetType",
]; ];
/** Measurement-name and corresponding field-key */ /** Measurement-name and corresponding field-key */
@ -66,7 +66,10 @@ function tagObjectRecursively(point, tag, field, suffix = ""){
tagObjectRecursively(point, tag, value, `_${key}${suffix}`); tagObjectRecursively(point, tag, value, `_${key}${suffix}`);
}); });
} }
else point.tag(tag+suffix, field); else {
const name = (tag+suffix).toLowerCase();
point.tag(name, field);
}
} }
/** Mapping for type -> field-method */ /** Mapping for type -> field-method */