Compare commits
5 Commits
c3cd6393d4
...
5303b31bd7
Author | SHA1 | Date | |
---|---|---|---|
5303b31bd7 | |||
94846a48e1 | |||
f00db16269 | |||
1bffd22735 | |||
41b2caecb3 |
@ -60,7 +60,7 @@ if(errorMsg){
|
||||
|
||||
logger.debug("Get WriteApi & set default-hostname to", `'${env.HOSTNAME}'`);
|
||||
const influxWriteApi = influxDb.getWriteApi(env.INFLUX_ORG, env.INFLUX_BUCKET, "us");
|
||||
influxWriteApi.useDefaultTags({"hostname": env.HOSTNAME});
|
||||
//influxWriteApi.useDefaultTags({"hostname": env.HOSTNAME});
|
||||
logger.info("Influx ok");
|
||||
|
||||
logger.info("Starting tcpdump..");
|
||||
|
@ -4,12 +4,12 @@ const {Point} = require("@influxdata/influxdb-client");
|
||||
|
||||
/** Keys to always use as tags */
|
||||
const TAG_LIST = [
|
||||
"srcmac",
|
||||
"dstmac",
|
||||
"srcMac",
|
||||
"dstMac",
|
||||
"bssid",
|
||||
"frequency",
|
||||
"flags",
|
||||
"packettype",
|
||||
"packetType",
|
||||
];
|
||||
|
||||
/** Measurement-name and corresponding field-key */
|
||||
@ -66,7 +66,10 @@ function tagObjectRecursively(point, tag, field, 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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user