Git Product home page Git Product logo

srslog's People

Contributors

calavera avatar cpuguy83 avatar derwolfe avatar ehashman avatar fxfitz avatar iaburton avatar lk4d4 avatar lvh avatar morganxf avatar oschwald avatar reaperhulk avatar scorptec68 avatar sirsean avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

srslog's Issues

Support for timeouted connection (net.DialTimeout)

Currently net.Dial and tls.Dial allows connection to take forever, it can stuck setup of syslog service.

However net.Dial can be changed to net.DialWithTimeout and tls.Dial to tls.DialWithDialer passing net.Dialer.

Consider to support RELP

Since TCP protocol only guarantee no data loss on the air, but the data in the TCP send buffer may lose. The RELP initialized by rsyslog aims to fix it. Could we consider to suppport RELP?

Enhancement to allow adding custom dialer

My solution needs to be FIPS-140-2 compliant, which is partly done by using a Go wrap of openssl for all cryptography instead of the standard net/crypto packages.
If a method were exposed that allowed me to add an entry to the dialers map in dialer.go, then I could register a method to call the dialer of my choice.
I've done this on a local copy of srslog. Is the any interest in adding this to the public branch?

RFC5424 formatter does not generate the STRUCTURED-DATA field

The RFC says the syslog format is (according to the syslog-ng doc):
HEADER STRUCTURED-DATA MSG

A sample could be

<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8

that corresponds to the following format

<priority>VERSION ISOTIMESTAMP HOSTNAME APPLICATION PID MESSAGEID STRUCTURED-DATA MSG

(ref: https://www.balabit.com/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html/concepts-message-ietfsyslog.html)

The RFC documentation (from IETF) says:

STRUCTURED-DATA provides a mechanism to express information in a well
defined, easily parseable and interpretable data format.  There are
multiple usage scenarios.  For example, it may express meta-
information about the syslog message or application-specific
information such as traffic counters or IP addresses.

STRUCTURED-DATA can contain zero, one, or multiple structured data
elements, which are referred to as "SD-ELEMENT" in this document.

In case of zero structured data elements, the STRUCTURED-DATA field
MUST contain the NILVALUE.

(ref: https://tools.ietf.org/html/rfc5424#section-6.3)

In our case, the best would be to add an hyphen (that is the NILVALUE indicated by the RFC) between the HEADER and the MESSAGE.

What do you think?

Minimal log level

Hi

Is there any way to set loggers log level ? I would like to log messages up to LOG_ERR.

Retry with another procotol if the first one is not available

Linking from: moby/moby#21613 .

Currently users of srslog (like Docker) must explicitly specify unix:// or unixgram:// when connecting to a Unix socket. Should srslog abstract this and simply retry connecting with another protocol if the first one fails? This is also the behavior of glibc (see comments in the issue above).

RFC3164 format not correctly being generated

I noticed that the formatter.go does not generate the Log according to RFC3164 specifications. There is a space between the priority and the timestamp whereas in the RFC the format specified says that there should be no space. Please find below an example taken from the RFC:
Example 1
<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8

The reason I pointed this out is because docker syslog uses this package for formatting and this is causing problems when I try to send the logs to a remote syslog (and trying to process them - gives me a parse error).

Also, if required I can open a pull request to do this change, as it seems to me as simple as removing a space. Please let me know if I am missing something here.

Use a TCP writer to `Write()` to a syslog server running with TLS only returns no `error` but actually failed

I use

w, err := syslog.Dial("tcp", "192.168.0.51:514", syslog.LOG_ERR, "testtag")
if err != nil {
  if n, err := w.Write([]byte("these are some bytes")); err != nil {
    log.Println("Sent %d bytes to syslog server\n", n)
  }
}

to connect to a rsyslog server, and the server is set to $InputTCPServerStreamDriverMode 1, which means it accepts TLS connection only.

The running result is that I was told

Sent 21 bytes to syslog server

but actually it's not the truth. Because the rsyslog server said,

rsyslogd: gnutls returned error on handshake: An unexpected TLS packet was received. [v8.31.0 try http://www.rsyslog.com/e/2083 ]
rsyslogd: gnutls returned error on handshake: An unexpected TLS packet was received. [v8.31.0 try http://www.rsyslog.com/e/2083 ]

Support per-msg MSGID

The way I see it, a tag is specified in the Dial 'constructor' and used for both the tag and msgid fields for RFC3164 and RFC5424 msg formats respectively. This is fine for RFC3164 because the tag doesn't typically change from message to message. But for RFC5424, the msgid should likely change, based on the msg type.

RFC5424 detailing MSGID: https://tools.ietf.org/html/rfc5424#section-6.2.7

I'm looking for consensus that this should be considered a 'defect', then I can put my thinking cap on regarding solutions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.