Splunk HEC for Home Assistant
A Splunk HTTP Event Collector library that follows best practices by opening a single connection to Splunk, and reuses it. When sending large or high volumes of events, or Splunk is slow, the events are batched together. This also allows events to be resent in the case of failures, as they are simply returned to the queue.
Requires you create an aiohttp Client Session, or reuse your applications existing one. From Home Assistant this would be homeassistant.helpers.aiohttp_client.async_get_clientsession
Methods
hass_splunk(session,token,host,port=8088,use_ssl=True,verify_ssl=True,endpoint="collector/event",timeout=5)
Session, token, and host are required, all other parameters are optional, and will be set to defaults shown.
check(connectivity=True, token=True, busy=True)
Returns True if the parameter conditions are okay, False if any fail or any other error is raised. You can selectively ignore certain conditions by setting them to False.
queue(payload, send=True)
The String or Dictionary to be sent to Splunk. By default it will be sent as soon as possible, but you can instead set send=False and it only be queued.
send()
The sends whatever data is in the queue, is what queue() uses internally when send=True.
Example
import asyncio
import aiohttp
import time
from hass_splunk import hass_splunk
async def main():
async with aiohttp.ClientSession() as session:
splunk = hass_splunk(
session=session,
host="http-inputs-stack.splunkcloud.com",
use_ssl=True,
verify_ssl=True,
token="private",
)
print(await splunk.check(connectivity=True, token=True, busy=True))
await splunk.queue(
{
"time": time.time(),
"host": "name",
"event": {
"meta": "TEST",
},
},
send=False,
)
await splunk.send()
asyncio.run(main())
Metadata
Release files for hass-splunk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hass_splunk-0.2.0.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hass_splunk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / hass_splunk-0.2.0.tar.gz
| Download URL | hass_splunk-0.2.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
658b4320e0f68022469ae41fa2fa30222c5fa34239b253a1f6a72e619d230333
|
|
BLAKE2b-256 checksum How to use checksums |
500845a79b756d984eae6f8164e13a44c6b124bd63384679add0a453f2e3d8fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / hass_splunk-0.2.0-py3-none-any.whl
| Download URL | hass_splunk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fe0d320d6ae0031d3441592d022b7d9d423aabb3880d8113f276798bcf38661
|
|
BLAKE2b-256 checksum How to use checksums |
a8a060aed4be729a715d0cd7e834769ea40d7fa95dd8709ced715ab934493e31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency log