Async Splunk SDK
Project description
aiosplunk
An asyncio-based Python module for interacting with Splunk. Currently limited to only searches. Very much a work-in-progress.
Installation
pip install aiosplunk
Examples
Run a search and dump results out to a CSV file
import aiofiles
from aiosplunk import SplunkClient, Search
from aiosplunk.search import OutputMode
client = SplunkClient(host="localhost", username="user", password="pass")
search = Search(
splunk_client=client,
search_string="search index=_internal | head 500000",
earliest="-4h",
latest="now",
output_mode=OutputMode.csv,
)
await search.run()
async with aiofiles.open("out.csv", "w") as f:
lines = []
async for line in s.get_results(fields=["_raw", "host"]):
lines.append(str(line) + "\n")
await f.writelines(lines)
Pull down results from an existing search and do something with the results
from aiosplunk import SplunkClient, Search
from aiosplunk.search import OutputMode
client = SplunkClient(host="localhost", username="user", password="pass")
search = await Search.from_sid(
splunk_client=client, sid="1734103773.893674", output_mode=OutputMode.dict
)
lines = []
async for d in search.get_results(fields=["_raw", "host", "my_field"]):
my_field = d.get("my_field")
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiosplunk-0.3.0.tar.gz.
File metadata
- Download URL: aiosplunk-0.3.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ab38e30a13fba995c5c2e96b430f23381cc943ce4f7938cfd197298cb6abe42
|
|
| MD5 |
6ce5682012b4c2a0ac087833be4dcfa8
|
|
| BLAKE2b-256 |
4b3c9d9bd998b17c4ad144dd02a352dca82df02fe019c388c70f2fdcb2c46f96
|
Provenance
The following attestation bundles were made for aiosplunk-0.3.0.tar.gz:
Publisher:
publish.yml on cschmidt0121/aiosplunk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiosplunk-0.3.0.tar.gz -
Subject digest:
3ab38e30a13fba995c5c2e96b430f23381cc943ce4f7938cfd197298cb6abe42 - Sigstore transparency entry: 198761053
- Sigstore integration time:
-
Permalink:
cschmidt0121/aiosplunk@6a1d34ff1b3537095c126fc364244d782e289f07 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/cschmidt0121
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a1d34ff1b3537095c126fc364244d782e289f07 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aiosplunk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: aiosplunk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f287ab63504a932157f8b489f6d0842235d0f77388fa52a00ff26af3028ea6f
|
|
| MD5 |
3c01e5f259740335fe5beb0a875dc5da
|
|
| BLAKE2b-256 |
c632a2f2ab0f28e05d6cf7a7cd82ff8d26b7f1811caaae85f0f3c792d0437f38
|
Provenance
The following attestation bundles were made for aiosplunk-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on cschmidt0121/aiosplunk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiosplunk-0.3.0-py3-none-any.whl -
Subject digest:
8f287ab63504a932157f8b489f6d0842235d0f77388fa52a00ff26af3028ea6f - Sigstore transparency entry: 198761058
- Sigstore integration time:
-
Permalink:
cschmidt0121/aiosplunk@6a1d34ff1b3537095c126fc364244d782e289f07 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/cschmidt0121
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a1d34ff1b3537095c126fc364244d782e289f07 -
Trigger Event:
push
-
Statement type: