logger-es-cli
CLI for sending logging to elasticsearch (alpha version)
How to build package
-
needs to have poetry installed.
sudo python3 -m pip install poetry
-
optional
sudo yum install redhat-rpm-config gcc libffi-devel python3-devel openssl-devel cargo sudo python3 -m pip install python-dotenv[cli]
-
run build command
poetry build
Access AWS ES with VPC access using a tunning ssh
-
open a terminal and issue the following command:
ssh -L 9200:vpc-kibana-dashboard-maneiro-brbrhuehue.sa-east-1.es.amazonaws.com:443 -i ~/.ssh/your-private-key.pem ec2-user@5.6.7.8
-
now try to send logs to elasticsearch
.env file env variables
example:
# kibana ip or dns
KIBANA_SERVER=localhost
# use SSL
KIBANA_SSL=true
# exclude default args from kibana
# if true exclude those following args:
# pathname,exc_info,exc_text,thread,threadName,stack_info,filename,processName,process,args,msg,name,levelname
EXCLUDE_DEFAULT=true
# kibana server port
KIBANA_SERVER_PORT=9200
# kibana username
KIBANA_USERNAME=robots.logger
# kibana password
KIBANA_PASSWORD=fd89078C-2e8e-4549-b9de-B9955123a0e3
# software environment
ENVIRONMENT=DEVELOPMENT
# project name that is the same index name in elastic search
PROJECT_NAME=gmf-tech-modulex
# exclude args to send to elasticsearch
EXCLUDE=thread,threadName,processName
# a custom json file , to append when send logs to elasticsearch
CUSTOM_FILE=/run/media/gustavo/backup/git-projects/logger-es-cli/custom.json
# unbuffer sysout python
PYTHONUNBUFFERED=true
# send debug logs to es?
SEND_DEBUG=false
custom.json file
example:
{
"username": "gustavo@gmf-tech.com",
"account": "system"
}
poetry export dependencies
poetry export -f requirements.txt --output requirements.txt
run logger-es-cli with a .env file [dotenv dependence]
dotenv run -- logger-es-cli info 'alo mundo louco!!!'
- Do not forget to issue command message with single quote. In bash if you send with double quotes, escape caracters will broken the CLI
License
This project is licensed under the terms of the MIT license.
Metadata
Release files for logger-es-cli 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| logger-es-cli-0.3.4.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logger_es_cli-0.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.0 kB
Release files / logger-es-cli-0.3.4.tar.gz
| Download URL | logger-es-cli-0.3.4.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff30b32c14f3e2db07c46a2835fc92cc070eb77de5f00b21a39da96e62fed3ec
|
|
BLAKE2b-256 checksum How to use checksums |
7bdd7ec0a25af3fb9c9d5ea38e0c1b6d61d3266fb2083f0e672304737d387a5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.9.5 Linux/5.12.8-1-MANJARO
|
Release files / logger_es_cli-0.3.4-py3-none-any.whl
| Download URL | logger_es_cli-0.3.4-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a2dd2521d82918d7d4b74b841a923e2a4e2a01771792058b990e6cc2b5aff69
|
|
BLAKE2b-256 checksum How to use checksums |
0b4ef1d2306bf485b820689a997f1e5e8aaba6dc67e4e998d42afbfb2be475b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.9.5 Linux/5.12.8-1-MANJARO
|