Skip to content
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

Merged
merged 3 commits into from
Feb 5, 2015
Merged

logmsg: added HOSTID #337

merged 3 commits into from
Feb 5, 2015

Conversation

lbudai
Copy link
Collaborator

@lbudai lbudai commented Dec 8, 2014

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

@lbudai
Copy link
Collaborator Author

lbudai commented Dec 8, 2014

OpenSSL is needed by hostid (this is why Travis failed).

We have two choices:

  • hostid will be available only when OpenSSL is enabled
  • enable using OpenSSL by default
    .

@bazsi
Copy link
Collaborator

bazsi commented Dec 8, 2014

I would enable openssl as mandatory, what do you think @algernon?

@algernon
Copy link
Contributor

algernon commented Dec 9, 2014

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.

@bazsi
Copy link
Collaborator

bazsi commented Dec 9, 2014

Macros are implemented in the core. In order to make this optional we'd
need to make macros pluggable, or use weak linking tricks to see if openssl
is available.

Again, we need openssl for generating random numbers in a portable way.
Uuid is another such case.
On Dec 9, 2014 8:14 AM, "Gergely Nagy" notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHub
#337 (comment).

@algernon
Copy link
Contributor

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 lbudai self-assigned this Dec 11, 2014
@bazsi
Copy link
Collaborator

bazsi commented Jan 16, 2015

@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.

@lbudai
Copy link
Collaborator Author

lbudai commented Jan 17, 2015

@bazsi: I will merge soon
created a separate branch for setting OpenSSL as a hard dependency
(reason of the separate branch is that if we have OpenSSL then -I think- we should build all SSL dependent features by default -> #368 )

@lbudai
Copy link
Collaborator Author

lbudai commented Jan 27, 2015

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.

lbudai and others added 3 commits February 1, 2015 10:14
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>
@bazsi
Copy link
Collaborator

bazsi commented Feb 5, 2015

This seems green now.

lbudai added a commit that referenced this pull request Feb 5, 2015
@lbudai lbudai merged commit 41bc909 into syslog-ng:master Feb 5, 2015
@lbudai lbudai removed the in progress label Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants