A package for query ElasticSearch and parse response easy
Project description
es_simple
A package for query ElasticSearch and parse response easy.
Usage
import es_simple
import time
qb = es_simple.QueryBuilder("hostname:*live*", # query string
int(time.time() * 1000 - 3600 * 1000), "start timestamp in ms"
int(time.time() * 1000), # end timestamp in ms
"5m", # interval
"log_timestamp", # time field
"Asia/Shanghai") # time zone
qb.add_metric("avg_tcp_re_rate", "avg", "tcp_re_rate")
qb.add_metric("avg_cpu", "avg", "cpu_idle")
qb.add_date_histogram_bucket("ts")
qb.add_terms_bucket("nodename", "nodename", "20", {"tcp_re_rerate": "desc"})
es_query = qb.build()
print(es_query)
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
es_simple-0.0.7.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file es_simple-0.0.7.tar.gz
.
File metadata
- Download URL: es_simple-0.0.7.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
58e7b5776eb892b1f276cb5a7aa79d60ace998bff7037ba2200ef51d744405c2
|
|
MD5 |
dbd2e8c41de1bd321d3664f9818c6b50
|
|
BLAKE2b-256 |
129ab524daf491b2b3fd6ac501a68d7a2a04dc0b42650e81c4a31bbbb11dceb7
|
File details
Details for the file es_simple-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: es_simple-0.0.7-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
2a953493f9fa9774524f18ba75b7831551901425aa588dad3ffbf2738d062d92
|
|
MD5 |
c73e12b51df7bda470eb6c1099830a6f
|
|
BLAKE2b-256 |
e87fbd9ab7f4f253d7373fbc0ac778f386d5e0a9a564fefa7a9c6595c1e49d70
|