@dx-do/client 6.2.1 → 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.cjs.js CHANGED
@@ -73721,6 +73721,18 @@ function detectIPv4() {
73721
73721
  }
73722
73722
  return '127.0.0.1';
73723
73723
  }
73724
+ /**
73725
+ * Coalesce a missing *or empty* value to a fallback.
73726
+ *
73727
+ * `??` only catches `null`/`undefined`, but an explicit `""` is a valid string
73728
+ * that would flow straight through. That breaks `temp_fields`: a blank component
73729
+ * collapses one of its space-separated slots, shifting every later field's
73730
+ * position when the SaaS Kafka consumer parses `agentbase_msg`. Treat `""`
73731
+ * exactly like an omitted value.
73732
+ */
73733
+ function orDefault(value, fallback) {
73734
+ return value ? value : fallback;
73735
+ }
73724
73736
  /**
73725
73737
  * Service for querying and ingesting log analytics data.
73726
73738
  */
@@ -73749,14 +73761,17 @@ class LogsService {
73749
73761
  exports.LogIngest.LogIngestOptionsSchema.parse(options);
73750
73762
  const cohortId = this.dxSaasService.dxdoConfiguration.dxConfiguration.cohortId;
73751
73763
  const tenantIdUpper = cohortId.toUpperCase();
73752
- const logtype = options.logtype ?? 'generic';
73753
- const host = options.host ?? require$$0$4.hostname();
73754
- const ip = options.ip ?? detectIPv4();
73755
- const agentInstance = options.agentInstance ?? 'dx-do';
73756
- const agentName = options.agentName ?? 'Logs Collector';
73757
- const containerId = options.containerId ?? host;
73758
- const containerName = options.containerName ?? agentInstance;
73759
- const file = options.file ?? 'dx-do.cli';
73764
+ // `orDefault` (not `??`) so an explicit empty string is treated as omitted —
73765
+ // a blank value in any temp_fields component shifts every downstream
73766
+ // positional field. See the temp_fields comment below.
73767
+ const logtype = orDefault(options.logtype, 'generic');
73768
+ const host = orDefault(options.host, require$$0$4.hostname());
73769
+ const ip = orDefault(options.ip, detectIPv4());
73770
+ const agentInstance = orDefault(options.agentInstance, 'dx-do');
73771
+ const agentName = orDefault(options.agentName, 'Logs Collector');
73772
+ const containerId = orDefault(options.containerId, host);
73773
+ const containerName = orDefault(options.containerName, agentInstance);
73774
+ const file = orDefault(options.file, 'dx-do.cli');
73760
73775
  const tag = `${logtype} logs`;
73761
73776
  // temp_fields must have exactly 9 space-separated components before the message
73762
73777
  // is appended by the SaaS filter (agentbase_msg = temp_fields + " " + message).