Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/greenpau/esqrunner
Run Elasticsearh queries and create metrics based on the result of the queries in Elasticsearch database.
https://github.com/greenpau/esqrunner
data-analysis elasticsearch query-builder querydsl
Last synced: 4 days ago
JSON representation
Run Elasticsearh queries and create metrics based on the result of the queries in Elasticsearch database.
- Host: GitHub
- URL: https://github.com/greenpau/esqrunner
- Owner: greenpau
- Created: 2020-04-25T15:38:23.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-09-07T22:04:20.000Z (over 1 year ago)
- Last Synced: 2024-05-23T00:30:59.565Z (8 months ago)
- Topics: data-analysis, elasticsearch, query-builder, querydsl
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elasticsearch Query Runner
Run Elasticsearh queries and create metrics based on the result
of the queries in Elasticsearch database.## Getting Started
First, define the metrics to collect from Elasticsearch. Please see
`assets/metrics/simple.json` for an example.```json
[
{
"id": "28e3c0fb594443fea16131c5f26eeb81",
"category": "Helpdesk",
"name": "Helpdesk Ticket Total",
"description": "The total number of helpdesk tickets",
"operation": "GET",
"base_index": "tickets-",
"index_split": "daily",
"dsl_function": "_count",
"dsl_query": {
"query": {
"bool": {
"must_not": [
{
"match_phrase": {
"classification": "internal"
}
}
]
}
}
}
}
]
```Next, create a configuration file pointing to the metrics and
identifying Elasticsearch:```yaml
---
metric_sources:
- 'assets/metrics/simple.json'
elasticsearch:
addr:
- 'http://localhost:9200'
```Finally, run `esqrunner` tool to create datasets:
```bash
./bin/esqrunner --config ~/tmpelastic/config.yaml --log-level debug --datepicker "last 7 days, interval 1 day" --output-file-prefix "metrics_last_7d"
```The expected output follows:
```
Output file prefix: /tmp/esqrunner-703462495/metrics_last_7d
Wrote data to /tmp/esqrunner-703462495/metrics_last_7d_landscape.csv
Wrote data to /tmp/esqrunner-703462495/metrics_last_7d_portrait.csv
Wrote data to /tmp/esqrunner-703462495/metrics_last_7d.json
Wrote data to /tmp/esqrunner-703462495/metrics_last_7d.js
```