Splunk HEC Stream
Project description
Splunk HEC Stream
Streaming logging handler for Splunk HEC
Example
import logging
import json
from datetime import datetime
from splunk_hec_stream.logging import SplunkHECStreamHandler
logging.basicConfig(
level=logging.INFO,
handlers=[SplunkHECStreamHandler("main", "splunk-logger-test", "aws:lambda", "_json")]
)
logging.info({"key1": "value1"})
logging.info("test")
logging.info('''test
ln''')
logging.info(json.dumps({"key1": "value1"}))
# You can overwrite logging time by _time extra key (must be float)
logging.info({"key": "value"}, extra={'_time': datetime.utcnow().timestamp()})
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
splunk_hec_stream-0.2.tar.gz
(2.3 kB
view hashes)