{ "info": { "author": "David Hamann", "author_email": "dh@davidhamann.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3.6" ], "description": "# log2http\n\nlog2http watches log files and sends new contents to a specified http endpoint. That's it.\n\n## Install\n\nYou will need Python >= 3.6.\n\nInstall the application like this (preferably in a [virtualenv](https://virtualenv.pypa.io/en/stable/)):\n\n`pip install log2http`\n\n## Setup\n\nPlace a YAML config file like the following at a location of your preference:\n\n```\n-\n logfile: /Users/demo/example.log\n endpoint: http://endpoint1.example.com/tag/sample\n min_lines: 5\n-\n logfile: /var/log/system.log\n endpoint: http://endpoint2.example.com/tag/syslog\n min_lines: 2\n```\n\n- `logfile` specifies the file to watch\n- `endpoint` is the http endpoint you want to send the collected log lines to (as POST). Usually, this will be the url of a logging service, e.g. `http://logs-01.loggly.com/bulk/token/tag/example/`\n- `min_lines` sets the minimum of lines that must be collected until a http request is made (use this to minimize http overhead per logged event)\n\n## Usage\n\nOnce installed, you can launch log2http from your terminal:\n\n`log2http --config=/path/to/the/config.yml`\n\nWhen log2http is running, create some sample events to see if they are being collected. For example in bash:\n\n`for i in {1..6}; do echo \"hello world\" >> example.log; done`\n\nThe output should tell you if events are being collected and sent.\n\nYou could also start the log collector from Python like this:\n\n```\nfrom log2http import load_config, LogCollector\n\nconfig = load_config('/your/path/to/config.yml')\ncollector = LogCollector(config)\nwith collector:\n collector.start() # will run until interrupted\n```\n\nWatch out: log lines always need to end with a newline character (`\\n`). If a line does not end with a newline character, log2http will wait indefinitely until it is written to the file.\n\n## Local development\n\nSee `requirements-dev.txt` for development requirements.\n\nRun tests with `pytest`.\n\nRun static type checking with `mypy --ignore-missing-imports log2http`.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/davidhamann/log2http", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "log2http", "package_url": "https://pypi.org/project/log2http/", "platform": "", "project_url": "https://pypi.org/project/log2http/", "project_urls": { "Homepage": "https://github.com/davidhamann/log2http" }, "release_url": "https://pypi.org/project/log2http/0.1.1/", "requires_dist": [ "requests (>=2)", "docopt (>=0.6.2)", "mypy-extensions (>=0.4.1)", "PyYAML (>=3.13)" ], "requires_python": ">=3.6", "summary": "log2http watches log files and sends new contents to a specified http endpoint.", "version": "0.1.1" }, "last_serial": 4397163, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6c0f91f4e0ae9eaa2b9603a2b72210f2", "sha256": "8f63cc1e468885b4e523071a86354b40d284638053962c199227b67e914e4e0c" }, "downloads": -1, "filename": "log2http-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6c0f91f4e0ae9eaa2b9603a2b72210f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 4992, "upload_time": "2018-10-06T23:35:15", "url": "https://files.pythonhosted.org/packages/56/1f/8c92230091cb9d6fd6eae2cdf7025f8c35fe76ee8b10286963aecfd19228/log2http-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a9c64664e944e20ca2b158f68573717d", "sha256": "a99b318d2077bcc2d2a483da2df1a63b20fc4fae39be07c57c9072d416b7d167" }, "downloads": -1, "filename": "log2http-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a9c64664e944e20ca2b158f68573717d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4234, "upload_time": "2018-10-06T23:35:17", "url": "https://files.pythonhosted.org/packages/ea/28/27031b8481f46e408cdb8e471ab6f13e9ed100b825efaee343679821d98a/log2http-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "4dc6387f8b1aa8577413e46801c1ac1f", "sha256": "6e3e3dd704fe94ff3395c8676b403e8c9aea6326bf85e5145484b9444d103020" }, "downloads": -1, "filename": "log2http-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4dc6387f8b1aa8577413e46801c1ac1f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5348, "upload_time": "2018-10-20T13:22:11", "url": "https://files.pythonhosted.org/packages/c0/fc/aa7793857ad202ddde50b28d7fcd0c5f2d4de619e1cd90201538306d38d8/log2http-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a17b5af289c7f79d6dfa9cfa39ba68c9", "sha256": "7fdf3072c085d1cbd17d09ef13fadfe485656d23ff3a4228c45f8ccdf6e5017a" }, "downloads": -1, "filename": "log2http-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a17b5af289c7f79d6dfa9cfa39ba68c9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4568, "upload_time": "2018-10-20T13:22:13", "url": "https://files.pythonhosted.org/packages/82/cd/bce21a319c0b0d2e11bd4020ca2b2e7ed5ab2ab6549454adb4839488622e/log2http-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4dc6387f8b1aa8577413e46801c1ac1f", "sha256": "6e3e3dd704fe94ff3395c8676b403e8c9aea6326bf85e5145484b9444d103020" }, "downloads": -1, "filename": "log2http-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4dc6387f8b1aa8577413e46801c1ac1f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5348, "upload_time": "2018-10-20T13:22:11", "url": "https://files.pythonhosted.org/packages/c0/fc/aa7793857ad202ddde50b28d7fcd0c5f2d4de619e1cd90201538306d38d8/log2http-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a17b5af289c7f79d6dfa9cfa39ba68c9", "sha256": "7fdf3072c085d1cbd17d09ef13fadfe485656d23ff3a4228c45f8ccdf6e5017a" }, "downloads": -1, "filename": "log2http-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a17b5af289c7f79d6dfa9cfa39ba68c9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4568, "upload_time": "2018-10-20T13:22:13", "url": "https://files.pythonhosted.org/packages/82/cd/bce21a319c0b0d2e11bd4020ca2b2e7ed5ab2ab6549454adb4839488622e/log2http-0.1.1.tar.gz" } ] }