Scribery / cockpit

Cockpit fork for work on Session Recording UI
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
6 stars 3 forks source link

Add _MACHINE_ID field to unique record identifier #20

Open spbnick opened 7 years ago

spbnick commented 7 years ago

Since journald can also receive logs from other hosts, it is possible that TLOG_REC values can collide in the same journal, since they would be generated on separate hosts.

Use _HOSTNAME in addition to TLOG_REC to uniquely identify recordings. However, if it's not actually guaranteed to be unique (likely), check if there is a more reliable way to identify origin hosts for journal messages.

See https://www.freedesktop.org/software/systemd/man/systemd-journal-remote.html and https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html

sabbaka commented 7 years ago

What about _MACHINE_ID= ( The machine ID of the originating host, as available in machine-id(5) )? https://www.freedesktop.org/software/systemd/man/machine-id.html

spbnick commented 7 years ago

Sounds good. Could you please verify that it is preserved on journal forwarding and you can actually distinguish messages coming from different hosts? The best test would be to do it with tlog messages and verify that recordings can be distinguished.

On Aug 21, 2017 10:14 AM, "Kyrylo Gliebov" notifications@github.com wrote:

What about _MACHINE_ID= ( The machine ID of the originating host, as available in machine-id(5) )?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Scribery/cockpit/issues/20#issuecomment-323676908, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhhfs4zcRZBcDvb5FKDR-DJdRA1anjWks5saTxigaJpZM4O7bhX .

sabbaka commented 7 years ago

journalctl _MACHINE_ID=<my_machine_id> and it worked. I'll check for journal forwarding also, but I will need somehow to have different logs from different machines, right?

spbnick commented 7 years ago

Hmm, I guess when you forward journal log from one machine to another the other machine log just ends up in the target machine's journal.

sabbaka commented 6 years ago

I've add machine ID, but strictly from the front-end perspective, we should also have the same session ID stored in journal. Right?