{ "info": { "author": "Andres Riancho", "author_email": "andres.riancho@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: System :: Monitoring" ], "description": "Splunk logger\n=============\n\nA logging handler for Splunk. Lets you send information to Splunk directly from your Python code.\n\n.. image:: https://circleci.com/gh/andresriancho/splunk-logger.png?circle-token=5f4c52c6972260273e0064a160dd9a503615a987\n :alt: Build Status\n :align: right\n :target: https://circleci.com/gh/andresriancho/splunk-logger\n \nUsage\n=====\n\nMake sure you replace the ``***`` with your credentials and specific API domain\nand run:\n\n::\n\n import logging\n from splunk_logger import SplunkLogger\n \n ACCESS_TOKEN = '***'\n PROJECT_ID = '***'\n API_DOMAIN = 'api-***.data.splunkstorm.com'\n \n splunk_logger = SplunkLogger(access_token=ACCESS_TOKEN,\n project_id=PROJECT_ID,\n api_domain=API_DOMAIN)\n logging.getLogger('').addHandler(splunk_logger)\n \n logging.error('This is sent to splunk')\n \nAfter a couple of seconds of waiting for Splunk to process the new information,\nyou should be able to see something like this in the web interface:\n\n::\n\n {\n data : \"This is sent to splunk\",\n level : \"ERROR\",\n line : 1,\n module : \"\"\n }\n\nWhen using the code in a real Python program, and not from the python console,\nthe real line number and module name are used.\n\nConfiguration file\n==================\n\nIt is always a good idea to avoid hardcoded credentials in your source code.\nThe module can fetch the credentials from a YAML file in the current directory\nor the user's home. The filename is named ``.splunk_logger`` and has the following\nformat:\n\n::\n\n credentials:\n project_id: ***\n access_token: ***\n api_domain: api-***.data.splunkstorm.com\n\nOnce the file is in place, you can use the module as follows:\n\n::\n\n import logging\n from splunk_logger import SplunkLogger\n\n # No credentials specified here\n splunk_logger = SplunkLogger()\n logging.getLogger('').addHandler(splunk_logger)\n \n logging.error('This is sent to splunk')\n\n\nConfiguration through environment variables\n===========================================\n\nAnother configuration source accepted by splunk logger is environment variables.\nOnce again, you can use them to avoid hard-coding credentials in the source code:\n\n* ``SPLUNK_PROJECT_ID``\n* ``SPLUNK_ACCESS_TOKEN``\n* ``SPLUNK_API_DOMAIN``\n\nEnhancements\n============\n\nThere are a couple of things which could be improved in this module\n\n* The logger could be refactored to send the messages in an async manner,\n this will make ``logging.foo()`` calls return immediately instead of waiting\n for the log message to be sent. \n* Send messages in batches\n \nPull requests are more than welcome!\n\nReferences\n==========\n\nThis package implements communication with Storm Splunk as specified `here\n`_ .\n\nReporting bugs\n==============\n\nReport your issues and feature requests in `Splunk Logger's issue\ntracker `_ and I'll\nbe more than glad to fix them.\n\nChange log\n==========\n\n* 30 Jun 2014: User needs to specify API endpoint domain. Fixes #2", "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/andresriancho/splunk-logger/", "keywords": null, "license": "GNU General Public License v2 (GPLv2)", "maintainer": null, "maintainer_email": null, "name": "splunk_logger", "package_url": "https://pypi.org/project/splunk_logger/", "platform": "Linux", "project_url": "https://pypi.org/project/splunk_logger/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/andresriancho/splunk-logger/" }, "release_url": "https://pypi.org/project/splunk_logger/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Splunk logger sends log messages to splunk directly from your Python code.", "version": "1.0.0" }, "last_serial": 1142270, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "e8a51146cf5851891dcb404d1933b5ae", "sha256": "97e2a7cfa323041d43688457afd003f86ca842196ad3cd52f691a7254d34f257" }, "downloads": -1, "filename": "splunk_logger-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e8a51146cf5851891dcb404d1933b5ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3053, "upload_time": "2013-05-31T13:31:53", "url": "https://files.pythonhosted.org/packages/f0/68/341281aa6f78f84511884d94a5a8e68d0e935c07a216c7c47c4e29e54b92/splunk_logger-0.1.1.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "d29b97c30c43bba86cab99b9cced9066", "sha256": "320f35dc66914ff559d41c136ced1ce2126257494adc8d0df8e7da285355a5dd" }, "downloads": -1, "filename": "splunk_logger-0.1.3.tar.gz", "has_sig": false, "md5_digest": "d29b97c30c43bba86cab99b9cced9066", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4809, "upload_time": "2013-06-07T16:08:03", "url": "https://files.pythonhosted.org/packages/cf/c3/620157d8a0bcb21af061f348021bae249c715fcdbbc9b88cecc7b157573d/splunk_logger-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "d814ff7ce82a5b942df084f64c6fed69", "sha256": "9f71c4822699a4c29ab0073415c40b8632dc35c9a3b6da72fe3819489cd55381" }, "downloads": -1, "filename": "splunk_logger-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d814ff7ce82a5b942df084f64c6fed69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4798, "upload_time": "2013-06-07T17:58:48", "url": "https://files.pythonhosted.org/packages/b7/02/b513bd12bc230f971df8a746d8e4818b926ddad76d01c0bfcc8fc9d81a0f/splunk_logger-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "5b7fc4ef3071b922b7a651572b3f3d83", "sha256": "50cfec657c45ba9e2ee3cf882d5d98912c5b251e18e5249c7534ebb1155f858f" }, "downloads": -1, "filename": "splunk_logger-0.1.5.tar.gz", "has_sig": false, "md5_digest": "5b7fc4ef3071b922b7a651572b3f3d83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5016, "upload_time": "2013-07-08T11:38:12", "url": "https://files.pythonhosted.org/packages/94/8f/7e4bce827280b801cebaa87d2aebe8658bb75346799e0f1bd7ab2a8bf426/splunk_logger-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "f37a22b829891a919c3737437e18d617", "sha256": "90dc3b62b6fdf5d69e688dec8bce1c9d95585516fb2448130945dc2e913a7df3" }, "downloads": -1, "filename": "splunk_logger-0.1.6.tar.gz", "has_sig": false, "md5_digest": "f37a22b829891a919c3737437e18d617", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5016, "upload_time": "2013-07-08T11:39:23", "url": "https://files.pythonhosted.org/packages/cb/d3/1b7db124d546f5d8ac2d6f95a5a7edd96f172c534af7d38853e05c5cef80/splunk_logger-0.1.6.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "83bd7be1240e387cd37704e3d22b3719", "sha256": "7f7b39e6629a09e14589542f9e3a825efcd7e3a7218a785c58129207879d42b1" }, "downloads": -1, "filename": "splunk_logger-0.2.0.tar.gz", "has_sig": false, "md5_digest": "83bd7be1240e387cd37704e3d22b3719", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5711, "upload_time": "2013-12-10T14:40:13", "url": "https://files.pythonhosted.org/packages/af/4d/1b756748deae67803694c53e024d53305da84b7f11905d98982efae29901/splunk_logger-0.2.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "70235a20590564178c6e18a1c4251e72", "sha256": "be0a8c87dbc2a447033f93ff3fbcdc56361cae37ff46c9446315326131643f16" }, "downloads": -1, "filename": "splunk_logger-1.0.0.tar.gz", "has_sig": false, "md5_digest": "70235a20590564178c6e18a1c4251e72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6195, "upload_time": "2014-06-30T15:52:58", "url": "https://files.pythonhosted.org/packages/ba/bd/64c2db322df72577dd3bc8db8ad95252dde1774bd8cb1898dd40af048587/splunk_logger-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "70235a20590564178c6e18a1c4251e72", "sha256": "be0a8c87dbc2a447033f93ff3fbcdc56361cae37ff46c9446315326131643f16" }, "downloads": -1, "filename": "splunk_logger-1.0.0.tar.gz", "has_sig": false, "md5_digest": "70235a20590564178c6e18a1c4251e72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6195, "upload_time": "2014-06-30T15:52:58", "url": "https://files.pythonhosted.org/packages/ba/bd/64c2db322df72577dd3bc8db8ad95252dde1774bd8cb1898dd40af048587/splunk_logger-1.0.0.tar.gz" } ] }