CLI for sending logging to elasticsearch
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
logger-es-cli-0.3.4.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file logger-es-cli-0.3.4.tar.gz
.
File metadata
- Download URL: logger-es-cli-0.3.4.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.12.8-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
ff30b32c14f3e2db07c46a2835fc92cc070eb77de5f00b21a39da96e62fed3ec
|
|
MD5 |
426d93dd51893a45fba0e8732bf9aa4e
|
|
BLAKE2b-256 |
7bdd7ec0a25af3fb9c9d5ea38e0c1b6d61d3266fb2083f0e672304737d387a5e
|
File details
Details for the file logger_es_cli-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: logger_es_cli-0.3.4-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.12.8-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6a2dd2521d82918d7d4b74b841a923e2a4e2a01771792058b990e6cc2b5aff69
|
|
MD5 |
c6f7890c6679cf02fa854ea103dddd6c
|
|
BLAKE2b-256 |
0b4ef1d2306bf485b820689a997f1e5e8aaba6dc67e4e998d42afbfb2be475b8
|