@dx-do/client 6.2.2 → 6.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -73699,6 +73699,18 @@ function detectIPv4() {
|
|
|
73699
73699
|
}
|
|
73700
73700
|
return '127.0.0.1';
|
|
73701
73701
|
}
|
|
73702
|
+
/**
|
|
73703
|
+
* Coalesce a missing *or empty* value to a fallback.
|
|
73704
|
+
*
|
|
73705
|
+
* `??` only catches `null`/`undefined`, but an explicit `""` is a valid string
|
|
73706
|
+
* that would flow straight through. That breaks `temp_fields`: a blank component
|
|
73707
|
+
* collapses one of its space-separated slots, shifting every later field's
|
|
73708
|
+
* position when the SaaS Kafka consumer parses `agentbase_msg`. Treat `""`
|
|
73709
|
+
* exactly like an omitted value.
|
|
73710
|
+
*/
|
|
73711
|
+
function orDefault(value, fallback) {
|
|
73712
|
+
return value ? value : fallback;
|
|
73713
|
+
}
|
|
73702
73714
|
/**
|
|
73703
73715
|
* Service for querying and ingesting log analytics data.
|
|
73704
73716
|
*/
|
|
@@ -73727,14 +73739,17 @@ class LogsService {
|
|
|
73727
73739
|
LogIngest.LogIngestOptionsSchema.parse(options);
|
|
73728
73740
|
const cohortId = this.dxSaasService.dxdoConfiguration.dxConfiguration.cohortId;
|
|
73729
73741
|
const tenantIdUpper = cohortId.toUpperCase();
|
|
73730
|
-
|
|
73731
|
-
|
|
73732
|
-
|
|
73733
|
-
const
|
|
73734
|
-
const
|
|
73735
|
-
const
|
|
73736
|
-
const
|
|
73737
|
-
const
|
|
73742
|
+
// `orDefault` (not `??`) so an explicit empty string is treated as omitted —
|
|
73743
|
+
// a blank value in any temp_fields component shifts every downstream
|
|
73744
|
+
// positional field. See the temp_fields comment below.
|
|
73745
|
+
const logtype = orDefault(options.logtype, 'generic');
|
|
73746
|
+
const host = orDefault(options.host, hostname());
|
|
73747
|
+
const ip = orDefault(options.ip, detectIPv4());
|
|
73748
|
+
const agentInstance = orDefault(options.agentInstance, 'dx-do');
|
|
73749
|
+
const agentName = orDefault(options.agentName, 'Logs Collector');
|
|
73750
|
+
const containerId = orDefault(options.containerId, host);
|
|
73751
|
+
const containerName = orDefault(options.containerName, agentInstance);
|
|
73752
|
+
const file = orDefault(options.file, 'dx-do.cli');
|
|
73738
73753
|
const tag = `${logtype} logs`;
|
|
73739
73754
|
// temp_fields must have exactly 9 space-separated components before the message
|
|
73740
73755
|
// is appended by the SaaS filter (agentbase_msg = temp_fields + " " + message).
|