{"id":18746847,"url":"https://github.com/homeworkprod/syslog2irc","last_synced_at":"2025-04-12T22:15:31.497Z","repository":{"id":2933589,"uuid":"3945269","full_name":"homeworkprod/syslog2irc","owner":"homeworkprod","description":"Forward syslog messages to IRC","archived":false,"fork":false,"pushed_at":"2021-12-07T03:55:25.000Z","size":402,"stargazers_count":22,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-12T22:15:27.878Z","etag":null,"topics":["irc","irc-bot","python","sysadmin","syslog"],"latest_commit_sha":null,"homepage":"http://homework.nwsnet.de/releases/c474/#syslog2irc","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/homeworkprod.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-05T23:49:14.000Z","updated_at":"2024-01-14T01:55:57.000Z","dependencies_parsed_at":"2022-09-20T12:25:35.262Z","dependency_job_id":null,"html_url":"https://github.com/homeworkprod/syslog2irc","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeworkprod%2Fsyslog2irc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeworkprod%2Fsyslog2irc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeworkprod%2Fsyslog2irc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeworkprod%2Fsyslog2irc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/homeworkprod","download_url":"https://codeload.github.com/homeworkprod/syslog2irc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637795,"owners_count":21137538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["irc","irc-bot","python","sysadmin","syslog"],"created_at":"2024-11-07T16:27:12.072Z","updated_at":"2025-04-12T22:15:31.478Z","avatar_url":"https://github.com/homeworkprod.png","language":"Python","readme":"==========\nsyslog2IRC\n==========\n\n.. image:: https://raw.githubusercontent.com/homeworkprod/syslog2irc/main/assets/syslog2irc_logo.svg\n   :alt: syslog2IRC logo\n   :height: 80\n   :width: 310\n\nForward syslog messages to IRC\n\nFor a more generic forwarder to IRC, check out `Weitersager \u003chttps://homework.nwsnet.de/releases/1cda/#weitersager\u003e`_.\n\n\nCode Status\n===========\n\n|badge_travis-ci_build|\n|badge_scrutinizer-ci_coverage|\n|badge_scrutinizer-ci_quality-score|\n|badge_code-climate_maintainability|\n\n\n.. |badge_travis-ci_build| image:: https://travis-ci.org/homeworkprod/syslog2irc.svg?branch=main\n   :alt: Build Status\n   :target: https://travis-ci.org/homeworkprod/syslog2irc\n\n.. |badge_scrutinizer-ci_coverage| image:: https://scrutinizer-ci.com/g/homeworkprod/syslog2irc/badges/coverage.png?b=main\n   :alt: Scrutinizer Code Coverage\n   :target: https://scrutinizer-ci.com/g/homeworkprod/syslog2irc/?branch=main\n\n.. |badge_scrutinizer-ci_quality-score| image:: https://scrutinizer-ci.com/g/homeworkprod/syslog2irc/badges/quality-score.png?b=main\n   :alt: Scrutinizer Code Quality\n   :target: https://scrutinizer-ci.com/g/homeworkprod/syslog2irc/?branch=main\n\n.. |badge_code-climate_maintainability| image:: https://api.codeclimate.com/v1/badges/7fc3553f7a7cf6502560/maintainability\n   :alt: Code Climate\n   :target: https://codeclimate.com/github/homeworkprod/syslog2irc\n\n\nRequirements\n============\n\n- Python 3.7+\n- Dependencies: blinker_, irc_, rtoml_, syslogmp_\n\n.. _blinker:  https://pythonhosted.org/blinker/\n.. _irc:      https://bitbucket.org/jaraco/irc\n.. _rtoml:    https://github.com/samuelcolvin/rtoml\n.. _syslogmp: https://homework.nwsnet.de/releases/76d6/#syslogmp\n\n\nInstallation\n============\n\nsyslog2IRC and its dependencies can be installed via pip_:\n\n.. code:: sh\n\n    $ pip install syslog2irc\n\nTo update an installed copy of syslog2IRC to the most recent release:\n\n.. code:: sh\n\n    $ pip install -U syslog2irc\n\n.. _pip:      http://www.pip-installer.org/\n\n\nConfiguration\n=============\n\n\nsyslog\n------\n\nSetup your ``syslog.conf`` or ``rsyslog.conf`` (commonly found in\n``/etc``) to send syslog messages to syslog2IRC on the default syslog\nport (514, UDP, as assigned by IANA_)::\n\n    *.*     @host-to-send-log-messages-to-and-this-script-runs-on\n\nOr, when syslog2IRC listens on a non-default port (here: 11514)::\n\n    *.*     @host-to-send-log-messages-to-and-this-script-runs-on:11514\n\n.. _IANA:     https://www.iana.org/\n\n\nsyslog2IRC\n----------\n\nConfiguration is done as a file in TOML_ format.\n\nA simple configuration to route from the default syslog port, 514, to a\nsingle IRC channel looks like this:\n\n.. code:: toml\n\n    [irc.server]\n    host = \"irc.server.example\"\n\n    [irc.bot]\n    nickname = \"syslog\"\n\n    [irc]\n    channels = [\n      { name = \"#syslog\" },\n    ]\n\n    [routes]\n    \"514/udp\" = [ '#syslog' ]\n\nIn a more complex setup, syslog messages could be received on multiple\nports (514/UDP and 55514/TCP in this example), with those received on\nthe first port being forwarded to two IRC channels, and those received\non the latter port being forwarded exclusively to the second channel.\n\nHere is a full example of an advanced configuration with all optional\nproperties being specified:\n\n.. code:: toml\n\n    log_level = \"warning\"        # optional\n\n    [irc.server]\n    host = \"irc.server.example\"  # optional\n    port = 6667                  # optional\n    ssl = false                  # optional\n    password = \"t0ps3cr3t\"       # optional\n    rate_limit = 0.5             # optional; limit of messages per second\n\n    [irc.bot]\n    nickname = \"syslog\"\n    realname = \"syslog\"          # optional\n\n    [irc]\n    commands = [                 # optional\n      \"MODE syslog +i\",\n    ]\n    channels = [\n      { name = \"#examplechannel1\" },\n      { name = \"#examplechannel2\", password = \"zePassword\" },\n    ]\n\n    [routes]\n    # routing for syslog messages from the ports on which they are\n    # received to the IRC channels they should be announced on\n    \"514/udp\" = [ '#examplechannel1', '#examplechannel2' ]\n    \"55514/tcp\" = [ '#examplechannel2' ]\n\n.. _TOML: https://toml.io/\n\n\nIRC Dummy Mode\n==============\n\nIf no value for ``irc.server.host`` is set (the property is missing or\ncommented out), syslog2IRC will not attempt to connect to an IRC server\nand start in IRC dummy mode.\n\nIn this mode, it will still receive syslog messages, but it will write\nthem to STDOUT. This can be helpful during setup of syslog message\nreception.\n\nAbort execution by pressing \u003cControl-C\u003e.\n\n\nUsage\n=====\n\nStart syslog2IRC with a configuration file:\n\n.. code:: sh\n\n    $ syslog2irc config.toml\n\nSend some messages to syslog2IRC using your system's syslog message\nsender tool (`logger`, in this example):\n\n.. code:: sh\n\n    $ logger 'Hi there!'\n    $ logger -p kern.alert 'Whoa!'\n\nNote that each message will appear twice on the console syslog2IRC was\nstarted because the handler itself will write it there anyway (so you\nhave a log on what would be sent to IRC).\n\nIf receiving syslog messages works and you have been using IRC dummy\nmode so far, specify an IRC server in the configuration file, then start\nas above:\n\n.. code:: sh\n\n    $ syslog2irc config.toml\n\nAfter a moment, you should see that syslog2IRC has connected to the IRC\nserver. The bot should then enter the channel(s) you have configured\n(see Configuration_).\n\n\nCustom Message Format\n=====================\n\nThe application's entry point is prepared to accept a custom callable to\nformat messages.\n\nArguably the easiest way to make use of this without fiddling inside of\nthe installed package's sources:\n\n- Copy the Python code from ``src/syslog2irc/formatting.py`` to a new\n  file outside of the package path, e.g. ``syslog2irc-custom.py``.\n- Adjust the copy of the function ``format_message`` as desired.\n- Import the entry point function into the new file, then call it while\n  passing the adjusted formatter function to it:\n\n  .. code:: python\n\n      from syslog2irc.main import main\n\n      if __name__ == '__main__':\n          main(custom_format_message=format_message)\n\n- Run the new file in the shell:\n\n  .. code:: sh\n\n      $ python syslog2irc-custom.py config.toml\n\n\nFurther Reading\n===============\n\nFor more information, see `RFC 3164`_, \"The BSD syslog Protocol\".\n\nPlease note that there is `RFC 5424`_, \"The Syslog Protocol\", which\nobsoletes `RFC 3164`_. syslog2IRC, however, only implements the latter.\n\n.. _RFC 3164: https://tools.ietf.org/html/rfc3164\n.. _RFC 5424: https://tools.ietf.org/html/rfc5424\n\n\n:Copyright: 2007-2021 `Jochen Kupperschmidt \u003chttps://homework.nwsnet.de/\u003e`_\n:License: MIT, see LICENSE for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomeworkprod%2Fsyslog2irc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomeworkprod%2Fsyslog2irc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomeworkprod%2Fsyslog2irc/lists"}