core icon indicating copy to clipboard operation
core copied to clipboard

Template support for remote syslog logging

Open r-duran opened this issue 5 years ago • 4 comments

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

  • [ ] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [ ] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Is your feature request related to a problem? Please describe.

When sending to remote syslog it is in csv form and hard to parse and hard to read raw log archives.

Describe the solution you like OPNsense already has a csv parser hat parses csv filterlogs and use fields in web GUI. There should be an option in the web GUI remote syslog config page that allow us to define a custom template for remote logs. That we should define any format there, be it JSON or key-value pairs etc that uses OPNsense field names as variables. Here is an example:

template = "protocol"="{protonum}", "ip_version"="{ipversion}", "src_ip"="src", "src_port":"srcport", "dst_ip":"dst", "dst_port":"dstport" etc etc

So the log should be rendered as "protocol"="17", "ip_version"="IPV4", "src_ip"="10.10.1.100", "src_port":"54512", "dst_ip":"8.8.8.8", "dst_port":"53"

With this, not only remote logs can be parsed easily, they will be easy to read in long term raw text archives.

Regards,

Rahman

r-duran avatar Nov 09 '21 09:11 r-duran

Hi Rahman,

We'er not considering plain text inputs since these can't be validated (https://docs.opnsense.org/development/guidelines/basics.html#safeguard-user-input), you can however add custom definitions into /usr/local/etc/syslog-ng.conf.d for manual overrides.

Best regards,

Ad

AdSchellevis avatar Nov 09 '21 09:11 AdSchellevis

/usr/local/etc/syslog-ng.conf.d

Hi Ad,

Ok, but can how can I access parsed log fields and use my format for remote sending, in syslog-ng config?

Regards,

Rahman

r-duran avatar Nov 09 '21 09:11 r-duran

Hi Rahman,

You will have to read the syslog-ng documentation about available options, when it's about fixed omissions in our configuration you can consider a feature request on our end (such as supporting non standard port numbers).

Best regards,

Ad

AdSchellevis avatar Nov 09 '21 09:11 AdSchellevis

This issue has been automatically timed-out (after 180 days of inactivity).

For more information about the policies for this repository, please read https://github.com/opnsense/core/blob/master/CONTRIBUTING.md for further details.

If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.

OPNsense-bot avatar May 08 '22 07:05 OPNsense-bot