-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logmsg: added HOSTID #337
logmsg: added HOSTID #337
Conversation
OpenSSL is needed by hostid (this is why Travis failed). We have two choices:
|
I would enable openssl as mandatory, what do you think @algernon? |
Does "enable by default" mean no way to turn it off? I'd advise against that (doesn't affect Debian, or most distros, but still). If it means highly recommended, on by default and errors out if not present, unless explicitly disabled - that is perfectly ok. |
Macros are implemented in the core. In order to make this optional we'd Again, we need openssl for generating random numbers in a portable way.
|
After a good nights sleep, I'm inclined to say to just depend on OpenSSL. It's not worth the trouble to try supporting a very uncommon case. |
@lbudai we seem to have reached conclusion. Could you merge this? I see that Travis failed, thats probably because the dependency needs to be added. |
After #368 is merged f/hostid branch is rebased to current master, now waiting for Travis. If everything goes well, I'll push the merge button. |
Signed-off-by: Laszlo Budai <stentor.bgyk@gmail.com>
After OpenSSL is a hard dependency in syslog-ng, non-embedded crypto lib is not a real option. Signed-off-by: Laszlo Budai <Laszlo.Budai@balabit.com>
HOSTID is a 32-bit number generated by a cryptographically secure PRNG. Its purpose is to identify the syslog-ng host, thus it is the same for every message of the host. It can be accessed via the $HOSTID macro. HOSTID is stored in the persist file (if the persist file removed, new HOSTID will be generated). Example config: source s_local { tcp( ip("127.0.0.1") port(10514) ); }; template t_hostid { template("msg:$MSG hostid:$HOSTID\n"); }; destination d_file { file("/tmp/hostid.ose.log" template(t_hostid)); }; log { source(s_local); destination(d_file); }; example value: msg:xxx hostid:5ec829c3 Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
This seems green now. |
HOSTID is a 32-bit number generated by a cryptographically secure PRNG.
Its purpose is to identify the syslog-ng host, thus it is the same for
every message of the host. It can be accessed via the $HOSTID macro.
HOSTID is stored in the persist file (if the persist file
removed, new HOSTID will be generated).
Example config:
source s_local {
tcp(
ip("127.0.0.1")
port(10514)
);
};
template t_hostid {
template("msg:$MSG hostid:$HOSTID\n");
};
destination d_file {
file("/tmp/hostid.ose.log" template(t_hostid));
};
log {
source(s_local);
destination(d_file);
};
example value:
msg:xxx hostid:5ec829c3
Signed-off-by: Budai Laszlo Laszlo.Budai@balabit.com