{ "info": { "author": "Matthieu Huin", "author_email": "softwarefactory-dev@redhat.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5" ], "description": "# OCHLERO\n\nOchlero is a script that monitors the systemd journal for specific events that\ntrigger publications on an MQTT queue.\n\n\"Ochlero\" comes from \"Ochlerotatus Triseriatus\", a species of tree hole breeding\nmosquitoes (https://en.wikipedia.org/wiki/Ochlerotatus_triseriatus), ie\nmosquitoes that like logs...\n\n## Running and testing\n\nOchlero is tested against and runs on python 2.7 and python 3.5.\n\nWith python 2.x you need to install the systemd and mqtt wrappers on your system.\nOn CentOS or Fedora, you can do so with the following command (extra repositories\nsuch as EPEL might need to be activated):\n\n```bash\nsudo yum install systemd-python python-paho-mqtt\n```\n\nThis is necessary due to a problem in the PyPI version of the systemd wrapper.\n\nWith python 3.5, running\n\n```bash\npip install -r requiremenits.txt\n```\n\nshould be enough.\n\nTo start ochlero, simply run\n\n```bash\nochlero -c /path/to/config/file.yaml\n```\n\n## The configuration file\n\nOchlero uses a yaml configuration file to define the mosquitto service to publish\nto, and the processes and events to look for. See etc/ochlero.yaml for an example.\n\n### Writing patterns\n\nWhen ochlero is running, it will attempt to match log lines associated with a given\nunit or command against patterns. A pattern is basically a regular expression.\nPlease refer to python's documentation for details on syntax, for example\nhttps://docs.python.org/2/howto/regex.html\n\nMost of the time, you will want to pick some information from the log line and\npublish it to MQTT. These elements of interest are defined in the pattern like\nbash variables, ie \"${ELEMENTNAME}. You must then define the regex matching for\neach variable in the directive \"where\" of your event. For example:\n\n```yaml\nevents\n - name: hello world\n pattern: \"hello, my name is ${PERSON}\"\n where:\n PERSON: [A-Za-z]+\n publish: \"Hi ${PERSON}!\"\n```\n\nA log message like \"Hello, my name is Mark\" will publish the message \"Hi Mark!\".\n\n### Predefined substitution types\n\nTo make it easier for you, some substitutions are included in ochlero so you don't\nhave to write annoying regular expressions:\n\n* \\_ALPHANUMERIC\\_\n* \\_INT\\_\n* \\_URL\\_\n* \\_EMAIL\\_\n* \\_IPv4\\_\n* \\_SYSLOGTIMESTAMP\\_\n\n### Writing messages to publish\n\nVariables can be reused as they are in publish messages (see previous example). Some\npredefined \"macros\" can also be used:\n\n* \\_EPOCH\\_ : the Unix Epoch timestamp at parsing time.\n\n## Contributing\n\nOchlero is developped in **Software Factory** and contributions follow a review workflow.\n\nTo contribute:\n\n1. Log in once to Software Factory at https://softwarefactory-project.io\n2. Set up your ssh key in Gerrit's settings page\n3. Clone the project:\n```bash\ngit clone ssh://@softwarefactory-project.io:29418/software-factory/ochlero.git\n```\n4. Set up git review\n```bash\ncd ochlero && git review -s\n```\n5. Work on your feature, make a commit, then send the review\n```bash\ngit commit -m'my feature' && git review\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://softwarefactory-project.io", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "ochlero", "package_url": "https://pypi.org/project/ochlero/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ochlero/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://softwarefactory-project.io" }, "release_url": "https://pypi.org/project/ochlero/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "systemd log monitor that publishes to an MQTT bus on specific events", "version": "0.2.0" }, "last_serial": 2755013, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "67d32ee445663656292c82472ae32a07", "sha256": "b75ab83f140310188f6a242af7f3fb369d40cf2df1eaa59c118dc9213383298d" }, "downloads": -1, "filename": "ochlero-0.1.1.tar.gz", "has_sig": false, "md5_digest": "67d32ee445663656292c82472ae32a07", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9731, "upload_time": "2017-03-17T20:16:43", "url": "https://files.pythonhosted.org/packages/83/f3/df455eae3ab50c19e09d0946fc05efed01983599f1cf5f635ba4a2e34551/ochlero-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "8c92b99192b58fd46d1aa7fac3d51b2c", "sha256": "b8ecd318c1a199c444b754bed0f790af610ab7c334bd6b036eb0fc32d0e819f6" }, "downloads": -1, "filename": "ochlero-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8c92b99192b58fd46d1aa7fac3d51b2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12979, "upload_time": "2017-04-05T13:47:02", "url": "https://files.pythonhosted.org/packages/38/b9/560a29056d23fdcede4f27c62a0675145f07833edf5c695d196a5c606148/ochlero-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8c92b99192b58fd46d1aa7fac3d51b2c", "sha256": "b8ecd318c1a199c444b754bed0f790af610ab7c334bd6b036eb0fc32d0e819f6" }, "downloads": -1, "filename": "ochlero-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8c92b99192b58fd46d1aa7fac3d51b2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12979, "upload_time": "2017-04-05T13:47:02", "url": "https://files.pythonhosted.org/packages/38/b9/560a29056d23fdcede4f27c62a0675145f07833edf5c695d196a5c606148/ochlero-0.2.0.tar.gz" } ] }