{"id":16940300,"url":"https://github.com/greenpau/esqrunner","last_synced_at":"2026-05-10T10:02:23.624Z","repository":{"id":83535407,"uuid":"258811562","full_name":"greenpau/esqrunner","owner":"greenpau","description":"Run Elasticsearh queries and create metrics based on the result of the queries in Elasticsearch database.","archived":false,"fork":false,"pushed_at":"2023-09-07T22:04:20.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-23T00:30:59.565Z","etag":null,"topics":["data-analysis","elasticsearch","query-builder","querydsl"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greenpau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-25T15:38:23.000Z","updated_at":"2023-09-07T22:04:25.000Z","dependencies_parsed_at":"2023-07-06T17:45:14.888Z","dependency_job_id":"d0d95728-caf2-424a-9b71-89ad9430be66","html_url":"https://github.com/greenpau/esqrunner","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"8d7bf498ceaa165c6cf658660617090ffa895b8e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fesqrunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fesqrunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fesqrunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fesqrunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greenpau","download_url":"https://codeload.github.com/greenpau/esqrunner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244720974,"owners_count":20498878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","elasticsearch","query-builder","querydsl"],"created_at":"2024-10-13T21:06:46.912Z","updated_at":"2026-05-10T10:02:23.523Z","avatar_url":"https://github.com/greenpau.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elasticsearch Query Runner\n\n\u003ca href=\"https://github.com/greenpau/esqrunner/actions/\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/greenpau/esqrunner/workflows/build/badge.svg?branch=master\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/greenpau/esqrunner\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/godoc-reference-blue.svg\"\u003e\u003c/a\u003e\n\nRun Elasticsearh queries and create metrics based on the result\nof the queries in Elasticsearch database.\n\n## Getting Started\n\nFirst, define the metrics to collect from Elasticsearch. Please see\n`assets/metrics/simple.json` for an example.\n\n```json\n[\n  {\n    \"id\": \"28e3c0fb594443fea16131c5f26eeb81\",\n    \"category\": \"Helpdesk\",\n    \"name\": \"Helpdesk Ticket Total\",\n    \"description\": \"The total number of helpdesk tickets\",\n    \"operation\": \"GET\",\n    \"base_index\": \"tickets-\",\n    \"index_split\": \"daily\",\n    \"dsl_function\": \"_count\",\n    \"dsl_query\": {\n      \"query\": {\n        \"bool\": {\n          \"must_not\": [\n            {\n              \"match_phrase\": {\n                \"classification\": \"internal\"\n              }\n            }\n          ]\n        }\n      }\n    }\n  }\n]\n```\n\nNext, create a configuration file pointing to the metrics and\nidentifying Elasticsearch:\n\n```yaml\n---\nmetric_sources:\n  - 'assets/metrics/simple.json'\nelasticsearch:\n  addr:\n    - 'http://localhost:9200'\n```\n\nFinally, run `esqrunner` tool to create datasets:\n\n```bash\n./bin/esqrunner --config ~/tmpelastic/config.yaml --log-level debug --datepicker \"last 7 days, interval 1 day\" --output-file-prefix \"metrics_last_7d\"\n```\n\nThe expected output follows:\n\n```\nOutput file prefix: /tmp/esqrunner-703462495/metrics_last_7d\nWrote data to /tmp/esqrunner-703462495/metrics_last_7d_landscape.csv\nWrote data to /tmp/esqrunner-703462495/metrics_last_7d_portrait.csv\nWrote data to /tmp/esqrunner-703462495/metrics_last_7d.json\nWrote data to /tmp/esqrunner-703462495/metrics_last_7d.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenpau%2Fesqrunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreenpau%2Fesqrunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenpau%2Fesqrunner/lists"}