{ "info": { "author": "Steven Hiscocks", "author_email": "steven@hiscocks.me.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", "Operating System :: POSIX :: Linux", "Programming Language :: C", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Logging" ], "description": "============\npyjournalctl\n============\n\nA python module that reads systemd journal similar to journalctl\n\nRequirements\n------------\n- python2 >= 2.7 or python3\n- systemd >= 187\n\nInstallation\n------------\npython setup.py install\n\nLicense\n-------\nGNU Lesser General Public License v2.1\n\nUsage Examples\n--------------\n>>> import pyjournalctl\n>>> journal = pyjournalctl.Journalctl()\n>>> journal.add_matches({\"PRIORITY\": \"5\", \"_PID\": \"1\"})\n>>> entry = journal.get_next()\n>>> print(\"PRIORITY: %(PRIORITY)i\" % entry)\nPRIORITY: 5\n>>> print(\"_PID: %(_PID)i\" % entry)\n_PID: 1\n>>> print(\"MESSAGE: %(MESSAGE)s\" % entry) # doctest: +ELLIPSIS\nMESSAGE: ...\n>>>\n>>> journal.flush_matches()\n>>> journal.seek(100) # 100 entries from start\n>>> journal.add_match(\"_TRANSPORT\", \"kernel\")\n>>> journal.add_disjunction() # OR next matches\n>>> journal.add_match(\"PRIORITY\", \"5\")\n>>> journal.add_match(\"_UID\", \"0\")\n>>> entry = journal.get_next(2) # Get second match\n>>> entry.get(\"_TRANSPORT\") == \"kernel\" or (\n... entry.get('PRIORITY') == 5 and entry.get(\"_UID\") == 0)\nTrue\n>>>\n>>> cursor = entry['__CURSOR'] # Cursor is unique reference\n>>> journal.flush_matches()\n>>> journal.seek(0,2) # End of journal\n>>> entry2 = journal.get_previous()\n>>> entry2['__CURSOR'] == cursor\nFalse\n>>> entry2 == entry\nFalse\n>>> journal.seek_cursor(cursor) # Seek to unique reference\n>>> journal.get_next() == entry\nTrue\n>>> realtime = entry['__REALTIME_TIMESTAMP']\n>>> journal.get_next(10) == entry\nFalse\n>>> journal.seek_realtime(realtime)\n>>> journal.get_next() == entry\nTrue\n>>> monotonic = entry['__MONOTONIC_TIMESTAMP']\n>>> bootid = entry['_BOOT_ID']\n>>> journal.get_next(5) == entry\nFalse\n>>> journal.seek_monotonic(int(monotonic.total_seconds()*1E6), bootid)\n>>> journal.get_next() == entry\nTrue\n>>> journal.flush_matches()\n>>> journal.seek(-1000,2) # Last 1000 entries\n>>> priorities = set(range(0,5))\n>>> journal.log_level(4) # Log level from 0 - 4\n>>> priorities >= set(entry['PRIORITY'] for entry in journal)\nTrue\n>>> systemd_units = journal.query_unique(\"_SYSTEMD_UNIT\")\n>>> print(\"Unique systemd units in journal: %s\" % ', '.join(systemd_units)) # doctest: +ELLIPSIS\nUnique systemd units in journal: ...\n>>> len(systemd_units) == len(set(systemd_units))\nTrue\n>>> journal.flush_matches()\n>>> journal.this_boot() # Only log entries from this boot\n>>> journal.seek(0) # First entry\n>>> entry = journal.get_next()\n>>> journal.seek(0,2) # Last entry\n>>> journal.get_previous()['_BOOT_ID'] == entry['_BOOT_ID']\nTrue\n>>> journal.flush_matches()\n>>> journal.seek(-1000,2) # Last 1000 entries\n>>> journal.this_machine() # Only log entries for this machine\n>>> len(set(entry['_MACHINE_ID'] for entry in journal))\n1\n\nKnown Issues\n------------\n* `seek_monotonic` seems to ignore `bootid` parameter. Can use seek monotonic by setting \"_BOOT_ID\" filter. Currently suspect this is issue with systemd c API `sd_journal_seek_monotonic_usec`...\n\nTODO\n----", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kwirk/pyjournalctl", "keywords": "systemd journald journal sd-journal systemd-journal", "license": "GNU Lesser General Public License (LGPL), Version 2", "maintainer": null, "maintainer_email": null, "name": "pyjournalctl", "package_url": "https://pypi.org/project/pyjournalctl/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyjournalctl/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kwirk/pyjournalctl" }, "release_url": "https://pypi.org/project/pyjournalctl/0.7.0/", "requires_dist": null, "requires_python": null, "summary": "A module that reads systemd journal similar to journalctl", "version": "0.7.0" }, "last_serial": 797317, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "afaef5363237659da308305d0058e3f7", "sha256": "b78760d34e7cba7675c16224c67c17b2ecb570c4149646686367dd466c02c4ee" }, "downloads": -1, "filename": "pyjournalctl-0.1.tar.gz", "has_sig": false, "md5_digest": "afaef5363237659da308305d0058e3f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4662, "upload_time": "2012-10-31T21:17:12", "url": "https://files.pythonhosted.org/packages/8d/9c/3d45aea09e430b1dd6cd1301895a92305bb8a43dab41dfcde7849cca6c6c/pyjournalctl-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "cfa2d424828e16fabef0d6a1d89a3804", "sha256": "8c2df4ba749e09690dc766b652e5bed60d33dc8af2e4a5156b9afe5716b2ad05" }, "downloads": -1, "filename": "pyjournalctl-0.1.1.tar.gz", "has_sig": false, "md5_digest": "cfa2d424828e16fabef0d6a1d89a3804", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4850, "upload_time": "2012-10-31T21:33:30", "url": "https://files.pythonhosted.org/packages/df/4b/1cee5052ad2753fe0131479cd06c101202889e2613bc91cdd9c2d61f444d/pyjournalctl-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b296d2aebe92a4f5ad769c7e30a3819f", "sha256": "7c6cd5ca5cbb9f29452b7ab8f896e6da232ec8f617abb7ada7595e9fa3c70197" }, "downloads": -1, "filename": "pyjournalctl-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b296d2aebe92a4f5ad769c7e30a3819f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5836, "upload_time": "2012-11-03T18:50:31", "url": "https://files.pythonhosted.org/packages/fc/90/ea69f07d9f26e56429f5d37a1b2510005023238e239fbd2be0eb3ab460fb/pyjournalctl-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "a80674e98ed27c9632d1c1af1588fef9", "sha256": "b271be4bc708d36a49834c9c9f07d6ab79cb81de2f371611b1cedc9331c93b0f" }, "downloads": -1, "filename": "pyjournalctl-0.3.0.tar.gz", "has_sig": false, "md5_digest": "a80674e98ed27c9632d1c1af1588fef9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7180, "upload_time": "2012-11-05T19:05:29", "url": "https://files.pythonhosted.org/packages/c7/f7/0aeb5a42664f5a2bbae2987ad0e47c84d1e10269fb9761083aa462d32c58/pyjournalctl-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "fffe5be50c978b89169c4e54b835baf0", "sha256": "23f100821cfdfaf78fa200097e0cc065d402277b5fca95dc610db4ca1a131bf9" }, "downloads": -1, "filename": "pyjournalctl-0.4.0.tar.gz", "has_sig": false, "md5_digest": "fffe5be50c978b89169c4e54b835baf0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8813, "upload_time": "2012-11-12T18:53:01", "url": "https://files.pythonhosted.org/packages/20/b1/d4bb117f2bec4e96c1e1069de0766102edd5cb02e05387fa244b042ffe2d/pyjournalctl-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "1065eebd04a72a174e96c898fbd807f2", "sha256": "1dbcb8152d6b330a94d9af4b49de4c94bf36196741f6738ae2e419e4e1d971b0" }, "downloads": -1, "filename": "pyjournalctl-0.5.0.tar.gz", "has_sig": false, "md5_digest": "1065eebd04a72a174e96c898fbd807f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9140, "upload_time": "2013-01-20T10:09:06", "url": "https://files.pythonhosted.org/packages/12/06/4521240e57c36860b5eb041f49942926ef73e98236e47de4ede48300c2ba/pyjournalctl-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "bad6b473b1a7e978ba68d063f1f5b76d", "sha256": "fb55b29cac490dbcd1887a6e1384831ef1d60f3c3669eb128a368b30e6240d07" }, "downloads": -1, "filename": "pyjournalctl-0.6.0.tar.gz", "has_sig": false, "md5_digest": "bad6b473b1a7e978ba68d063f1f5b76d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9599, "upload_time": "2013-02-01T19:33:25", "url": "https://files.pythonhosted.org/packages/26/57/59eb86c4326c16ee748369b4a3819df42c06a277f1fc6d752c593c3e152a/pyjournalctl-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "02512b43f27e5d54b4b2c85dc62f9308", "sha256": "9146b1fb7c0efed4f2896686a62578cfe12d6488b98abc865af10b1d824555b0" }, "downloads": -1, "filename": "pyjournalctl-0.6.1.tar.gz", "has_sig": false, "md5_digest": "02512b43f27e5d54b4b2c85dc62f9308", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9648, "upload_time": "2013-02-01T22:13:09", "url": "https://files.pythonhosted.org/packages/22/45/21bdf863da23b90d25248873a7ed19725258dcd4376419288305e8ca7c43/pyjournalctl-0.6.1.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "956b9522e83a483678b607172fd65518", "sha256": "f22bec22146dd5a79431caeead992bf77df75b579dcbf80b2e48beec22efecee" }, "downloads": -1, "filename": "pyjournalctl-0.7.0.tar.gz", "has_sig": false, "md5_digest": "956b9522e83a483678b607172fd65518", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10299, "upload_time": "2013-02-03T11:02:38", "url": "https://files.pythonhosted.org/packages/54/92/79f58c61c622707cb87fb547d2a6ce3aa4f8c69545e0939a1b9792989094/pyjournalctl-0.7.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "956b9522e83a483678b607172fd65518", "sha256": "f22bec22146dd5a79431caeead992bf77df75b579dcbf80b2e48beec22efecee" }, "downloads": -1, "filename": "pyjournalctl-0.7.0.tar.gz", "has_sig": false, "md5_digest": "956b9522e83a483678b607172fd65518", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10299, "upload_time": "2013-02-03T11:02:38", "url": "https://files.pythonhosted.org/packages/54/92/79f58c61c622707cb87fb547d2a6ce3aa4f8c69545e0939a1b9792989094/pyjournalctl-0.7.0.tar.gz" } ] }