Windows host.id not unique

Hello, we are facing a similar issue, see also:

The duplicate host.id might be caused by e.g. non-persistent VDIs or when you duplicate machines from a “golden image”.

See also my post about a way to alter the host.id:

This can easily be done via registry in Windows and (although not tested by me: for Linux & MacOS it could be possible to alter these values):

The add_host_metadata processor adds a host.id field to every Beat event by default. The value is retrieved in go-sysinfo:

  • Linux: Reads /etc/machine-id, /var/lib/dbus/machine-id, and /var/db/dbus/machine-id. (machineid.go)

  • macOS: IOPlatformUUID via the gethostuuid API call. (machineid_darwin_amd64.go)

  • Windows: Registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid (machineid_windows.go)

See also:

I hope this helps. By altering the MachineGuid I could find a way to circumvent the duplicate host.id values. A solution could be a script that checks its hostname against a table of generated custom UUIDs and setting the corresponding MachineGuid to the matching value in the list. This way even for non-persistent VDIs there could be a way to have “persistent”, “unique” host.ids.