{ "info": { "author": "Tobias Kiertscher", "author_email": "dev@mastersign.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "\nlogsweet\n========\n\n A suite with a variety of tools for handling log messages.\n\nThe name *logsweet* is a word play by combining *sweet logging* and a\n*suite of logging tools*.\n\nRequirements\n------------\n\n- Python \u22653.4\n\nInstallation\n------------\n\nPython Package ``logsweet``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n pip install logsweet\n\nor\n\n::\n\n python ./setup.py install\n\nDocker Image ``mastersign/logsweet``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThere is a public Docker image for *logsweet* available.\n\n.. code:: sh\n\n docker run --rm -it mastersign/logsweet [command] [OPTIONS] [ARGUMENTS]\n\nRemember to mount log files as volumes into the container, when using\nthe ``watch`` or ``mock`` command.\n\nUsage\n-----\n\nLogsweet supports the following commands:\n\n- ``watch`` watches for new lines in text files (e.g.\u00a0log files) and\n broadcasts them via a \u2205MQ PUB socket and/or sends them via a \u2205MQ PUSH\n socket.\n- ``listen`` listens to new lines broadcasted via \u2205MQ PUB socket and/or\n collects new lines from \u2205MQ PUSH sockets and prints them on the\n console.\n- ``proxy`` can connect to watchers at the backend and to listeners at\n the frontend. It supports both transmission modes (PUB/SUB and\n PUSH/PULL) at both backend and frontend. It can be used as a single\n point of knowledge or to build groups of log streams.\n- ``mock`` to write random log messages to text files for testing\n purposes.\n\nOne or more known services\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAt the service hosts ``service-1`` and ``service-2`` run:\n\n.. code:: sh\n\n logsweet watch -b *:9000 \"/var/log/myservice/*.log\"\n\nTo watch the two services:\n\n.. code:: sh\n\n logsweet listen -c service-1:9000 -c service-2:9000\n\nUse a proxy for dynamic services\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFirst start the proxy on host ``log-proxy`` to wait for backend\nconnections from services on port 9001 and frontend connections from\nlisteners on port 9002:\n\n.. code:: sh\n\n logsweet proxy -bb *:9001 -fb *:9002\n\nRun one or more listeners to print the messages:\n\n.. code:: sh\n\n logsweet listen -c log-proxy:9002\n\nStart one or more watchers to send log messages to the proxy:\n\n.. code:: sh\n\n logsweet watch -c log-proxy:9001 \"/var/log/myservice/*.log\"\n\nUse two proxies for high availability\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFirst start two proxies on host ``log-proxy-1`` and ``log-proxy-2``:\n\n.. code:: sh\n\n logsweet proxy -bb *:9001 -fb *:9002\n\nThen start one or more listeners to print the messages:\n\n.. code:: sh\n\n logsweet listen -c log-proxy-1:9002 -c log-proxy-2:9002\n\nStart one or more watchers to send log messages to the proxies:\n\n.. code:: sh\n\n logsweet watch -c log-proxy-1:9002 -c log-proxy-2:9002 \"/var/log/myservice/*.log\"\n\nIf multiple proxies are alive, the load is balanced evenly over all\nproxies. If a proxy becomes unavailable, its load is automatically taken\nby the remaining proxies.\n\nWrite random log messages for testing\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou can write random log messages to one or more log files in order to\ntest *logsweet* and its usage scenarios:\n\n.. code:: sh\n\n logsweet mock -i 0.2 /var/log/test/1.log /var/log/test/2.log\n\nUse the ``-i`` or ``--interval`` option to control the interval for new\nlog messages in seconds.\n\nConfiguration\n-------------\n\nThe commands ``watch`` and ``listen`` can process a YAML configuration\nfile. The configuration controls *filtering*, *coloring* output and\ntriggering *actions*.\n\nFor the command ``watch`` to print the text lines, the switch ``--echo``\nmust be used.\n\nA configuration file is specified with the ``-cfg `` option.\nHere is an example:\n\n.. code:: yaml\n\n version: '0.1'\n\n # The include statement is an array of regular expressions or a single one.\n # A log messages is dropped if it does not match any of the expressions.\n include:\n - 'error|Error|ERROR'\n - 'warning|Warning|WARNING'\n\n # The exclude statement is an array of regular expressions or a single one.\n # A log message is dropped if it matches any of the expressions.\n exclude: 'ignore\\s+this'\n\n # The colors statement is an array of colorization rules.\n # The rules are tried in the given order until one matches.\n colors:\n # A colorization rule must have a pattern, which is a regular expression,\n # optionally with named groups.\n - pattern: '\\[ERROR\\]'\n # There are multiple color statements with the syntax of.\n # [on ]\n # Every color is a color name from the X11 rgb.txt.\n # Spcifically the names supported by the Python package colorful\n # are supported.\n # The color names are Camel Case with a lower first letter.\n line: red # line specifies a color for the whole line\n match: black on lightGrey # match specifies a color for the whole match\n\n - pattern: '^.*?(?P\\[[A-Z]+\\]).*(?Padmin|user)'\n line: lightGrey\n match: white\n level: yellow\n user: cyan\n\n # The actions statement is an array of action rules.\n # The rules are all tried, regardless of matches.\n # To execute actions from a watch or listen command,\n # the switch -x or --exec-action must be used.\n actions:\n # An action rule must have a pattern, which is a regular expression,\n # optionally with named groups.\n - pattern: '\\[ERROR\\] (?P.*)$'\n # If the rule has an url property, it is considered an HTTP GET action.\n # The URL is treaded as a Python string template,\n # that means it can contain variables from the named regex groups.\n url: 'http://127.0.0.1:23456/notify-error/${err}'\n # A timeout in seconds can be specified,\n # to limit the amount of time used to execute the HTTP request.\n timeout: 2.5\n\n\n*******\nChanges\n*******\n\nAll notable changes to this project will be documented in this file.\nUntil this project reaches the maturity of version 1.0.0, the versioning\nfollows the following rules:\n\n- The MAJOR number is 0.\n- The MINOR number increases, if backward compatibility was broken\n or an important set of features has been added.\n- The PATCH number increases, if backward compatible features\n have been added or bugs got fixed.\n\nAfter this project reaches the version number 1.0.0 it will follow\n`Semantic Versioning `_.\n\n..\n\tThis document follows the guidelines in http://keepachangelog.md.\n\tUse the following change groups:\n\n\t\tAdded, Changed, Deprecated, Removed, Fixed, Security\n\n\tAdd a link to the GitHub diff like\n\n\t\t.. _``: https://github.com/mastersign/logsweet/compare/v...v\n\t\t``_ - \n\t\t==========================\n\n\nUnreleased\n==========\n\nAdded\n-----\n\n- proxy\n- binding and connecting on all sides\n- Docker release\n- YAML configuration for filtering, coloring and HTTP actions\n- improved CLI\n\n0.0.0 - 2019-02-21\n===================\n\nAdded\n-----\n\n- basic project structure\n- text file watcher with ZeroMQ PUB\n- ZeroMQ SUB with printing\n- mockup log files\n- basic CLI\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mastersign/logsweet", "keywords": "lib logsweet", "license": "BSD-3", "maintainer": "Tobias Kiertscher", "maintainer_email": "dev@mastersign.de", "name": "logsweet", "package_url": "https://pypi.org/project/logsweet/", "platform": "", "project_url": "https://pypi.org/project/logsweet/", "project_urls": { "Homepage": "https://github.com/mastersign/logsweet" }, "release_url": "https://pypi.org/project/logsweet/0.1.0/", "requires_dist": [ "click (>=6)", "pyzmq (>=16)", "PyYAML (>=3)", "colorful (<1,>=0.5)", "requests-futures (<1,>=0.9)" ], "requires_python": "", "summary": "Broadcast and receive log messages over network.", "version": "0.1.0" }, "last_serial": 4914767, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "691dfaa4601d7346d42bb340e732b26e", "sha256": "a592d729a9445e58caaac710ffb72e8cdea38697620cc522fa030e75f881dede" }, "downloads": -1, "filename": "logsweet-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "691dfaa4601d7346d42bb340e732b26e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22365, "upload_time": "2019-03-08T09:55:07", "url": "https://files.pythonhosted.org/packages/41/a5/e6e7549dbc10adc8b043dd6704604e6dc2b266522d1510bf7ac9d4273e12/logsweet-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3534ea552e37e928d11ec4636162ea43", "sha256": "f6cecdb9b42ac97d7a5a622b9b0593d8d9dfcc84e6d24c46e6b07bee05b5e413" }, "downloads": -1, "filename": "logsweet-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3534ea552e37e928d11ec4636162ea43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17172, "upload_time": "2019-03-08T09:55:09", "url": "https://files.pythonhosted.org/packages/80/e8/6a914fc199704731fc022d2dcdd14316559b30fa5807149bbfcfdfaa675b/logsweet-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "691dfaa4601d7346d42bb340e732b26e", "sha256": "a592d729a9445e58caaac710ffb72e8cdea38697620cc522fa030e75f881dede" }, "downloads": -1, "filename": "logsweet-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "691dfaa4601d7346d42bb340e732b26e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22365, "upload_time": "2019-03-08T09:55:07", "url": "https://files.pythonhosted.org/packages/41/a5/e6e7549dbc10adc8b043dd6704604e6dc2b266522d1510bf7ac9d4273e12/logsweet-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3534ea552e37e928d11ec4636162ea43", "sha256": "f6cecdb9b42ac97d7a5a622b9b0593d8d9dfcc84e6d24c46e6b07bee05b5e413" }, "downloads": -1, "filename": "logsweet-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3534ea552e37e928d11ec4636162ea43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17172, "upload_time": "2019-03-08T09:55:09", "url": "https://files.pythonhosted.org/packages/80/e8/6a914fc199704731fc022d2dcdd14316559b30fa5807149bbfcfdfaa675b/logsweet-0.1.0.tar.gz" } ] }