https://github.com/hellqvio86/splunkhecwriter
Python library for sending events to Splunk HEC (Http Event Collector)
https://github.com/hellqvio86/splunkhecwriter
hec splunk
Last synced: 6 months ago
JSON representation
Python library for sending events to Splunk HEC (Http Event Collector)
- Host: GitHub
- URL: https://github.com/hellqvio86/splunkhecwriter
- Owner: hellqvio86
- License: apache-2.0
- Created: 2021-09-04T17:02:51.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-16T07:23:05.000Z (almost 5 years ago)
- Last Synced: 2025-09-21T09:59:34.174Z (10 months ago)
- Topics: hec, splunk
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
     
# splunkhecwriter
Library for sending log events to Splunk
## Example Code block 1
```python
from splunkhecwriter import SplunkHECWriter
hec_token = ''
splunk_server = '127.0.0.1'
hec_writer = SplunkHECWriter(splunk_host=splunk_server, splunk_hec_token=hec_token)
msg = { 'foo': 'bar' }
hec_writer.send_msg(msg=msg)
```
## Example Code block 2
```python
from splunkhecwriter import SplunkHECWriter
hec_token = ''
splunk_server = '127.0.0.1'
hec_writer = SplunkHECWriter(splunk_host=splunk_server, splunk_hec_token=hec_token)
msgs = []
msgs.append({ 'foo': 'bar' })
msgs.append({ 'bar': 'foo'})
hec_writer.send_msgs(msgs=msgs)
```
## Example Code block 3
```python
from splunkhecwriter import SplunkHECWriter
hec_token = ''
splunk_server = '127.0.0.1'
sourcetype= 'foobar:json'
source = 'hec'
host = 'foobar'
hec_writer = SplunkHECWriter(
splunk_host=splunk_server,
splunk_hec_token=hec_token,
sourcetype=sourcetype,
source=source,
host=host)
msg = { 'foo': 'bar' }
hec_writer.send_msg(msg=msg)
```
## License
This project is licensed under the Apache License - see the [LICENSE.md](LICENSE.md) file for details
## Disclaimer
This custom component is neither affiliated with nor endorsed by Splunk.