This is a package for internal use only. Use with Python 3.8+.
Usage
On command line:
$ pip install pysplunk
Add this code to the entryfile:
from pysplunk import splunk
splunk.configure_logger(
index="index_name",
token="splunk_token",
version="1.0.0",
env="production",
level="DEBUG")
To log something:
splunk.loginfo(
account=account_id,
workflowtype="workflow_type",
workflowinstance="workflow_instance",
msg="message",
customfields={"customField1": 3})
splunk.logdebug(
account=account_id,
workflowtype="workflow_type",
workflowinstance="workflow_instance",
msg="message",
customfields={"customField1": 3})
splunk.logwarn(
account=account_id,
workflowtype="workflow_type",
workflowinstance="workflow_instance",
msg="message",
customfields={"customField1": 1, "customField2": "2"})
splunk.logerror(
account=account_id,
workflowtype="workflow_type",
workflowinstance="workflow_instance",
msg="message",
customfields={"customField1": 1},
evidencia="Exception traceback")
Definitions
account: An integer representing the ID of the logged account.
workflowtype: Some identification for the overall operation, example: “login”.
workflowinstance: Some identification for the specific part of the operation, examples “start_login”, “login_error”, “superuser_login”, etc
msg: A desciptive message of the log.
customfields: Additional fields, examples: “operation_id”, “user_id”, “product_id”, etc.
evidencia: Some string evidence (can be multiline) to attach into the log. This is convenient to add exceptions or API responses.
Configuration
AEROSPIKE_EVIDENCE_URL URL for aerospike
AEROSPIKE_EVIDENCE_TTL TTL for aerospike evidence, default: 2592000 seconds
AEROSPIKE_EVIDENCE_TIMEOUT Timetou for sending data to aerospike, default: 0.800 seconds
SPLUNK_URL URL for splunk
SPLUNK_LOG_FORMAT Splunk log format, default is set in splunk.py
SPLUNK_LOG_HANDLER_NAME Handler for splunk log, default: Log
Requirements
splunkfowarder is required for this package work.
Metadata
Release files for pysplunk 1.0.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 | Provenance | Actions |
|---|---|---|---|---|
| pysplunk-1.0.0.tar.gz | 4.7 kB | Without provenance | Details for pysplunk-1.0.0.tar.gz |
Release files / pysplunk-1.0.0.tar.gz
| Download URL | pysplunk-1.0.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6922de1cd81be3820db72c4caacdadf64d75bb0031cc4e4940ff5ac76ebf4cb
|
|
BLAKE2b-256 checksum How to use checksums |
22a03af3ac8b975c209051d8d7fce4b79bed7e5d7741c38f95f69de7759250a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.2
|
Security for pysplunk 1.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.