{ "info": { "author": "thanos vassilakis", "author_email": "thanosv@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Utilities" ], "description": "========\nOverview\n========\n\n\n\nThe ultimate rotation and windows friendly log tailer plus a lot more...\n\n- backfills rotated files\n- handles gz and bz2 files\n- handles multi line records\n- doesn't break windows rotating log handlers\n- easy to extend\n- Free software: BSD license\n- other than six pure Python stdlib.\n\nInstallation\n============ \n\n::\n \n pip install tailchaser\n \nThsi will install the tailchaser library in your site-packages and it will also add the script tailchase to your Scripts directory. \n\n\nUsage\n===== \n \n::\n\n $ tailchase /where/my/logs/*.log\n\n $ tailchase -h\n \n usage: tailchase [-h] [--only-backfill] [--dont-backfill]\n [--clear-checkpoint] [--read-period READ_PERIOD]\n [--read-pause READ_PAUSE] [--reading-from {unix,win}]\n [--temp-dir TEMP_DIR]\n [--logging {DEBUG,INFO,WARN,ERROR,CRITICAL}]\n file-pattern\n\n\n positional arguments:\n file-pattern The file pattern to tail, such as /var/log/access.*\n\n optional arguments:\n -h, --help show this help message and exit\n --only-backfill dont't tail, default: False\n --dont-backfill basically only tail, default: False\n --clear-checkpoint start form the begining, default: False\n --read-period READ_PERIOD\n how long you read before you pause. If zero you don't\n pause, default: 1\n --read-pause READ_PAUSE\n how long you pause between reads, default: 0\n --reading-from PLATFORM\n sets how long you read and then pause can be one of {unix,win}, default: win\n --temp-dir TEMP_DIR on back fill files are copied to a temp directory.Use\n this to set this directory, default: None\n --logging LEVEL\n logging level it can be one of DEBUG,INFO,WARN,ERROR,CRITICAL, default: ERROR\n\n\n\nIn its simplest form\n--------------------\n\nIn its simplest form tailchase works like a combination of cat and tail -f except it will start with the oldest rotated file. So if you were to have ::\n\n /var/log/opendirectoryd.log\n /var/log/opendirectoryd.log.0\n /var/log/opendirectoryd.log.1\n /var/log/opendirectoryd.log.2\n /var/log/opendirectoryd.log.3\n /var/log/opendirectoryd.log.4\n\nit would first output the text of /var/log/opendirectoryd.log.4, then /var/log/opendirectoryd.log.3, etc. until it reached the newest file then when it has reached the end of /var/log/opendirectoryd.log revert to a \"tail -f\" behaviour.\n\nSo if you were to do ::\n \n tailchase 'tests/logs/opendirectoryd.*'\n \n\"*note: In bash you need to quote the wildcard otherwise it will be expanded into the scripts argv array.*\"\n\nyou would get something like ::\n\n 2015-12-24 15:39:56.733754 EST - AID: 0x0000000000000000 - Registered node with name '/Contacts'\n 2015-12-24 15:39:56.733933 EST - AID: 0x0000000000000000 - Registered node with name '/LDAPv3' as hidden\n 2015-12-24 15:39:56.736154 EST - AID: 0x0000000000000000 - Registered node with name '/Local' as hidden\n 2015-12-24 15:39:56.736868 EST - AID: 0x0000000000000000 - Registered node with name '/NIS' as hidden\n 2015-12-24 15:39:56.737134 EST - AID: 0x0000000000000000 - Discovered configuration for node name '/Search' at path ' 2015-12-24 15:39:56.737151 EST - AID: 0x0000000000000000 - Registered node with name '/Search'\n 2015-12-24 15:39:56.738794 EST - AID: 0x0000000000000000 - Loaded bundle at path '/System/Library/OpenDirectory/Modules 2015-12-24 15:39:56.740509 EST - AID: 0x0000000000000000 - Loaded bundle at path '/System/Library/OpenDirectory/Modules/\n\n\nCoding with tailchaser\n======================\n\n\nUsing the tailchaser library in a project is probably best done by example.\n\n\nExample 1 - Tailchase to a REST service.\n----------------------------------------\n\n::\n\n #\n # Example 1 - Tail to Elastic\n #\n\n import requests\n\n import tailchaser\n\n class TailToElastic(tailchaser.Tailer):\n def handoff(self, file_tailed, checkpoint, record):\n \"\"\" Expect a record like:\n\n 20160204 10:28:15,525 INFO PropertiesLoaderSupport - Loading properties file from URL [file:C:/WaterWorks/Broken/BSE//config/lme-market.properties]\n 20160204 10:28:15,541 INFO PropertiesLoaderSupport - Loading properties file from URL [file:C:/WaterWorks/Broken/BSE//config/default-database.properties]\n 20160204 10:28:15,541 INFO PropertiesLoaderSupport - Loading properties file from URL [file:C:/WaterWorks/Broken/BSE//config/default-hibernate.properties]\n \"\"\"\n\n date, time, level, source, _, message = record.split(5)\n result = requests.json(\"http://someelacticserver.com:9200/myindex/log\", json={\n 'timestamp': '{}T{}'.format(date, time)\n 'level': level,\n 'source': source,\n 'message': message\n })\n return result.status_code == requests.codes.ok\n\n\nExample 2 - Tailchase to Kafka\n-------------------------------\n\n::\n \n #\n # Example 2 - Tail to Kafka - shows how to add your own arguments and then send messages to kafka.\n #\n\n from kafka import KafkaProducer\n rom tailchaser.tailer import Tailer\n \n \n class TailToKafka(Tailer):\n def add_arguments(cls, parser=None):\n parser = super(TailToKafka, cls).add_arguments(parser)\n\n HOSTS = 'localhost:1234'\n TOPIC = b'log'\n def startup(self):\n self.kafka_producer = KafkaProducer(bootstrap_servers=self.HOSTS,value_serializer=msgpack.dumps)\n\n\n def handoff(self, file_tailed, checkpoint, record):\n \"\"\" Expect a record like:\n\n 20160204 10:28:15,525 INFO PropertiesLoaderSupport - Loading properties file from URL [file:C:/WaterWorks/Broken/BSE//config/lme-market.properties]\n 20160204 10:28:15,541 INFO PropertiesLoaderSupport - Loading properties file from URL [file:C:/WaterWorks/Broken/BSE//config/default-database.properties]\n 20160204 10:28:15,541 INFO PropertiesLoaderSupport - Loading properties file from URL [file:C:/WaterWorks/Broken/BSE//config/default-hibernate.properties]\n \"\"\"\n self.kafka_producer.send(self.TOPIC, record).get(timeout=10)\n return True\n \n\n\nExample 3 - Saving and Loading last Offset from Zookeeper \n---------------------------------------------------------\n\n::\n\n #\n # Example 3 - Saving and Loading last Offset from Zookeeper \n #\n import platform\n import pickle\n import six\n from kazoo.client import KazooClient\n from tailchaser.tailer import Tailer\n\n class TailToElastic(Tailer):\n def start(self):\n self.zk = KazooClient(hosts=self.config.zookeeper_host)\n self.zk.start()\n \n \n def stop():\n self.zk.stop()\n \n def load_checkpoint(self):\n zk_path = self.config.checkpoint_filename\n try:\n checkpoint = pickle.loads(self.zk.get(zk_path))\n log.debug('loaded: %s %s', zk_path, checkpoint)\n return checkpoint\n except (IOError, EOFError):\n log.debug('failed to load: %s', zk_path)\n return self.INIT_CHECKPOINT\n\n def save_checkpoint(self, checkpoint):\n log.debug('dumping %s %s', self.config.checkpoint_filename, checkpoint)\n return self.zk.set(self.config.checkpoint_filename, six.b(pickle.dumps(checkpoint)))\n\n\n @staticmethod\n def make_checkpoint_filename(source_pattern, path=None):\n zk_path = '/'.join(['tailchase', platform.node(), slugify(source_pattern)]\n self.zk.ensure_path(zk_path)\n return zk_path\n\n\nDocumentation\n=============\n\nhttps://tailchaser.readthedocs.org/\n\nDevelopment\n===========\n\nTo run the all tests run::\n\n tox\n\nNote, to combine the coverage data from all the tox environments run:\n\n.. list-table::\n :widths: 10 90\n :stub-columns: 1\n\n - - Windows\n - ::\n\n set PYTEST_ADDOPTS=--cov-append\n tox\n\n - - Other\n - ::\n\n PYTEST_ADDOPTS=--cov-append tox\n\n\n\nChangelog\n=========\n\n0.2.7 (2016-07-24)\n--------------------\n* added --filter-re to filter out lines #15\n\n0.2.1 (2016-04-30)\n--------------------\n* Fixed #12 where Handoff is getting the tmp file name...\n* removed temp files after handoff #14\n\n0.2.0 (2016-04-30)\n--------------------\n* Added pipe code from ilabs code base.\n* Added example of storing check points remotely #8\n* Added REST configuration #9\n* Added INIT_CHECKPOINT class attribute to Tailer #11\n\n\n\n0.1.3 (2016-04-12)\n--------------------\n* Added break tail tests and fixes drived from it - #6\n* fixed app description ! - #7\n\n0.1.2 (2016-04-05)\n--------------------\n* Add multi-line record support - #3\n* add --start-of-record-re option for multi-line records. - #4\n* move argparser definition from cli to Tailer class. - #5\n\n0.1.0 (2016-02-21)\n------------------\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thanos/tailchaser", "keywords": "tail,watch,logs", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "tailchaser", "package_url": "https://pypi.org/project/tailchaser/", "platform": "", "project_url": "https://pypi.org/project/tailchaser/", "project_urls": { "Homepage": "https://github.com/thanos/tailchaser" }, "release_url": "https://pypi.org/project/tailchaser/0.2.8/", "requires_dist": null, "requires_python": "", "summary": "the ultimate tailer", "version": "0.2.8" }, "last_serial": 2296148, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "45ee1d46de1d6bad31faee04a4edb98f", "sha256": "c4f60fa8b53b1d392a9fd39bbca46f9aea40a7789512f7bd4cd265f684d65559" }, "downloads": -1, "filename": "tailchaser-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "45ee1d46de1d6bad31faee04a4edb98f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8182, "upload_time": "2016-03-08T04:16:29", "url": "https://files.pythonhosted.org/packages/e0/41/55b12a0098516e5b32290bac9874f34b2bc9c4400fa683cb5b65a84742e7/tailchaser-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32113df8e180aa8e831492f50f34256a", "sha256": "1765e56f0dfcfb3e462089f3ebee43a630719ee4301f772df92ce60bf66a57a2" }, "downloads": -1, "filename": "tailchaser-0.1.0.tar.gz", "has_sig": false, "md5_digest": "32113df8e180aa8e831492f50f34256a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18366, "upload_time": "2016-03-08T04:16:11", "url": "https://files.pythonhosted.org/packages/b5/9a/d0a4888b35930b04323af1638722fdd74e216804f931d250be098cd2ae8a/tailchaser-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "437b67539a8cf44f32df72ab3c32e0c0", "sha256": "2aedb9a18349fe7d9bd2e1b18924245811132d197c80f3aabd117332be9f291b" }, "downloads": -1, "filename": "tailchaser-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "437b67539a8cf44f32df72ab3c32e0c0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11730, "upload_time": "2016-04-05T03:13:38", "url": "https://files.pythonhosted.org/packages/bc/62/53a493c698d59325398b4fe9b5810187aa03f1686d6a3a16f096a3d412fd/tailchaser-0.1.1-py2.py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "47071c6edde2a475a6f805d3a5d97bef", "sha256": "904ff92fb9b4e15ffba84195c5ec902a2af055f59b578c91ba26f1a3ba2138ba" }, "downloads": -1, "filename": "tailchaser-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "47071c6edde2a475a6f805d3a5d97bef", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12540, "upload_time": "2016-04-10T22:30:01", "url": "https://files.pythonhosted.org/packages/b3/9d/f7da363d049bfd726cface97369cb6f8629b00b57da80128ab15dd165524/tailchaser-0.1.2-py2.py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6f000ee0a84722ac796f689edf8c24ba", "sha256": "2db890661fa52a3331aad68b0cd5b89d62dc44cecc424c0f7a7f7005bb05fb41" }, "downloads": -1, "filename": "tailchaser-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6f000ee0a84722ac796f689edf8c24ba", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12639, "upload_time": "2016-04-13T00:25:07", "url": "https://files.pythonhosted.org/packages/33/34/428f1091adb39a497ee13e3a66b6ae067e7f4fafd1d4bf6064ebdbf0a5ac/tailchaser-0.2.0-py2.py3-none-any.whl" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "5f9b71f7507a64a6ef3c589b7e61ecf1", "sha256": "55795f133a25a9ef88e299a7c908d90ee4b16dce1061c6946b1faa9f04a8abf2" }, "downloads": -1, "filename": "tailchaser-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5f9b71f7507a64a6ef3c589b7e61ecf1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14473, "upload_time": "2016-05-07T05:29:58", "url": "https://files.pythonhosted.org/packages/2a/03/39579c68213f9e4dd9230d96cfad210cdcb50de8150645941bc2271730af/tailchaser-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1600149d3da95d7f85cee14187c6520", "sha256": "60db5ffa6d338e6a61ede8a4227ac82fbd513e54005e36607f646de61c884515" }, "downloads": -1, "filename": "tailchaser-0.2.3.tar.gz", "has_sig": false, "md5_digest": "c1600149d3da95d7f85cee14187c6520", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27363, "upload_time": "2016-05-07T05:30:26", "url": "https://files.pythonhosted.org/packages/d4/b9/45f2bba732af7196653d60b406be542ef4cc8e421a8d3c2ea1c16629c844/tailchaser-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "e9d2ec3c5c0fbd7f366904bcb5185888", "sha256": "1ee87a08543d507556bb8022c3a5c3216aa20c4a31c929f3fba293ea04799360" }, "downloads": -1, "filename": "tailchaser-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e9d2ec3c5c0fbd7f366904bcb5185888", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15361, "upload_time": "2016-05-11T20:24:15", "url": "https://files.pythonhosted.org/packages/74/e5/d4bf56f9eafcdb98bd9488c1e6f4049da7f31e338e0b388c69992c019147/tailchaser-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "615c7c01fcd5e50e8ac7ddd593ccace3", "sha256": "22ff83633d34962d3872bcb5cb0f6dfcad369192ecd67bf6697b5569f7d600eb" }, "downloads": -1, "filename": "tailchaser-0.2.4.tar.gz", "has_sig": false, "md5_digest": "615c7c01fcd5e50e8ac7ddd593ccace3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28278, "upload_time": "2016-05-11T20:25:11", "url": "https://files.pythonhosted.org/packages/97/8f/30b5ff1250324ccfba96d21a119fa5af5ba8cc5633f16598462604d83aaf/tailchaser-0.2.4.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "4fd4b1b87e937c271b23290c5e29d212", "sha256": "0fd6b292e55c49547c3d0d6c3ed9c0787e6759fed38e473121f72155af8fcad6" }, "downloads": -1, "filename": "tailchaser-0.2.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4fd4b1b87e937c271b23290c5e29d212", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15373, "upload_time": "2016-05-12T17:27:12", "url": "https://files.pythonhosted.org/packages/5d/34/4f6823e1b71ee074ec6d385fbdb3687b4f2e9b104a02e740dcd2a3188680/tailchaser-0.2.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4b0cbbb02e0f63efc9546534ba92d96c", "sha256": "ad5e5ff01c33f36987fafc444df749a6b1b97640b16b9589b14e45c2ec079447" }, "downloads": -1, "filename": "tailchaser-0.2.6.tar.gz", "has_sig": false, "md5_digest": "4b0cbbb02e0f63efc9546534ba92d96c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28284, "upload_time": "2016-05-12T17:27:19", "url": "https://files.pythonhosted.org/packages/77/f3/83298a9aad45bb43cb15eaa37f4897e4da083d5263df41de088f70e84e90/tailchaser-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "129c12f1ce9b92d5db0bf80b90221068", "sha256": "9dc811ae2f4f1334990c5a39a9d3cddd7c9b8dc4d354d6f6b974a97f26ed8113" }, "downloads": -1, "filename": "tailchaser-0.2.7.tar.gz", "has_sig": false, "md5_digest": "129c12f1ce9b92d5db0bf80b90221068", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31623, "upload_time": "2016-07-24T20:02:20", "url": "https://files.pythonhosted.org/packages/9d/c6/0a98629994c5e218274e8affcb4b8a138fd8637c6602a2b7716e97a80178/tailchaser-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "85cc1ecaff318c52c7d8ad73062e5b02", "sha256": "ab3047ebe603182b68aeafbd0e8a14e818565a80b8aac0a6856e907354e5115d" }, "downloads": -1, "filename": "tailchaser-0.2.8.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "85cc1ecaff318c52c7d8ad73062e5b02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18684, "upload_time": "2016-08-22T17:46:03", "url": "https://files.pythonhosted.org/packages/6a/ec/9a17ab9ddedec0a792dcda66ee643fa224e00adcd2911c3a51d14c2834d8/tailchaser-0.2.8.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "58a95ef5e95b08d94f672cc31ee5fabf", "sha256": "aa1034014ac885813efd1a4810e60778b5a4a1ef0d6b934c43e6c5944fb1d3f4" }, "downloads": -1, "filename": "tailchaser-0.2.8.tar.gz", "has_sig": false, "md5_digest": "58a95ef5e95b08d94f672cc31ee5fabf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29482, "upload_time": "2016-08-22T17:46:06", "url": "https://files.pythonhosted.org/packages/b7/60/4532b95f070077b04981acdc060e8058f56d7057f19ce33e7fe20f2ff890/tailchaser-0.2.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "85cc1ecaff318c52c7d8ad73062e5b02", "sha256": "ab3047ebe603182b68aeafbd0e8a14e818565a80b8aac0a6856e907354e5115d" }, "downloads": -1, "filename": "tailchaser-0.2.8.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "85cc1ecaff318c52c7d8ad73062e5b02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18684, "upload_time": "2016-08-22T17:46:03", "url": "https://files.pythonhosted.org/packages/6a/ec/9a17ab9ddedec0a792dcda66ee643fa224e00adcd2911c3a51d14c2834d8/tailchaser-0.2.8.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "58a95ef5e95b08d94f672cc31ee5fabf", "sha256": "aa1034014ac885813efd1a4810e60778b5a4a1ef0d6b934c43e6c5944fb1d3f4" }, "downloads": -1, "filename": "tailchaser-0.2.8.tar.gz", "has_sig": false, "md5_digest": "58a95ef5e95b08d94f672cc31ee5fabf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29482, "upload_time": "2016-08-22T17:46:06", "url": "https://files.pythonhosted.org/packages/b7/60/4532b95f070077b04981acdc060e8058f56d7057f19ce33e7fe20f2ff890/tailchaser-0.2.8.tar.gz" } ] }