https://github.com/martincastroalvarez/python-splunk-cli
Python integration with Splunk.
https://github.com/martincastroalvarez/python-splunk-cli
cli python3 splunk
Last synced: about 1 year ago
JSON representation
Python integration with Splunk.
- Host: GitHub
- URL: https://github.com/martincastroalvarez/python-splunk-cli
- Owner: MartinCastroAlvarez
- Created: 2019-04-18T19:46:10.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-15T18:56:58.000Z (about 7 years ago)
- Last Synced: 2025-02-14T17:31:35.351Z (over 1 year ago)
- Topics: cli, python3, splunk
- Language: Python
- Homepage: https://martincastroalvarez.com
- Size: 134 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Topaz
*Splunk CLI*

## Installation
```
git clone ssh://git@github.com/MartinCastroAlvarez/topaz
cd topaz
virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt
```
## Configuration
Put the following content in *$HOME/.topaz*
```
{
"my_company": {
"account": "my_company",
"username": "###########",
"password": "####"
}
}
```
## Usage
#### Search Splunk alerts in the last 15 minutes.
```
python3 topaz.py --index sandbox --search seagull --start 15m
```
```
901:80''>
Start monitoring Consul & Python...'>
Starting python app: seagull...'>
Start consul-template in daemon mode...'>
Running consul-template once...'>
CONSUL_IP is 10.0.12.123'>
CONSUL_IP not set, looking for AWS instance IP'>
Checking for CONSUL_IP environment variable'>
Starting start.sh of base-pyservice...'>
```
### Search for startup errors.
```
python3 topaz.py --index sandbox --search startup --start 15m
```
### Filter messages by log level.
```
python3 topaz.py --index sandbox --search startup --start 15m --level ERROR,WARNING
```