Skip to main content

Async single threaded connector to Splunk HEC using an asyncio session

Project description

Splunk HEC for Home Assistant

Requires you create an aiohttp Client Session, or reuse your existing one from homeassistant.helpers.aiohttp_client.async_get_clientsession

Example

import asyncio
import aiohttp
from hass_splunk import hass_splunk

async def main():
    async with aiohttp.ClientSession() as session:
        splunk = hass_splunk(session=session,host="192.168.1.1",use_ssl=True,verify_ssl=False,token="private")
        print(await splunk.check(connectivity=True, token=True, busy=True))
        await splunk.queue({
                "time": 0,
                "host": "name",
                "event": {
                    "meta": "TEST",
                },
            },send=False)
        await splunk.send()
asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hass_splunk-0.0.3.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

hass_splunk-0.0.3-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page