{"id":22358306,"url":"https://github.com/gfleury/gstreamtop","last_synced_at":"2026-03-10T08:02:30.520Z","repository":{"id":80803009,"uuid":"155056128","full_name":"gfleury/gstreamtop","owner":"gfleury","description":"Real time analytical SQL Query on text streams","archived":false,"fork":false,"pushed_at":"2023-07-26T12:58:04.000Z","size":918,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T07:51:58.916Z","etag":null,"topics":["aggregation","analytics","interactive","real-time","regex","sql","stream-processing","text"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfleury.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-28T09:52:03.000Z","updated_at":"2020-11-09T22:15:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"09b91e9e-a0e8-4a39-b7b1-cd32aacbf376","html_url":"https://github.com/gfleury/gstreamtop","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gfleury/gstreamtop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfleury%2Fgstreamtop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfleury%2Fgstreamtop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfleury%2Fgstreamtop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfleury%2Fgstreamtop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfleury","download_url":"https://codeload.github.com/gfleury/gstreamtop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfleury%2Fgstreamtop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267867803,"owners_count":24157357,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aggregation","analytics","interactive","real-time","regex","sql","stream-processing","text"],"created_at":"2024-12-04T15:14:05.920Z","updated_at":"2026-03-10T08:02:25.472Z","avatar_url":"https://github.com/gfleury.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/gfleury/gstreamtop.svg?branch=master)](https://travis-ci.org/gfleury/gstreamtop) [![codecov](https://codecov.io/gh/gfleury/gstreamtop/branch/master/graph/badge.svg)](https://codecov.io/gh/gfleury/gstreamtop)\n\n# gstreamtop\n\nGstreamtop is a text stream SQL query tool (fancy wording). It basically maps plain text lines/json/csv entries as SQL table fields and allowing to run SQL queries. The main purpose is aggregation (queries must have GROUP BY).\nSimplifying you can tail a log file and run a SQL query aggregating for something. Differently from ELK stack or Kafka + KSQL (of course there is no comparison between the tools), the idea is to have something locally that you can run quickly (as a test or probe) and without external dependencies.\n\n## Example\n\n[![asciicast](https://asciinema.org/a/Y8qSzmLxPFXFETAMCbCtcYWdB.png?autoplay=1)](https://asciinema.org/a/Y8qSzmLxPFXFETAMCbCtcYWdB?autoplay=1)\n\n## Testing\n\n```bash\ngstreamtop$ make\ngstreamtop$ tail -f /var/log/nginx/access_log | ./gstreamtop runQuery combinedlog \"SELECT URLIFY(url) as url, COUN(*) as count, SUM(size) as sum, size, MAX(response) FROM log GROUP BY url, size ORDER BY count ASC, size DESC LIMIT 20;\"\n```\n\n## Mappings\n\nThe text to field maps is done on the mappings.yaml file. The regex in 'FIELDS IDENTIFIED BY' is the one that creates the mapping.\n\n```yaml\n- name: combinedlog\n  tables:\n  - CREATE TABLE log(ip VARCHAR, col2 VARCHAR, col3 VARCHAR, dt VARCHAR, method VARCHAR,\n    url VARCHAR, version VARCHAR, response INTEGER, size INTEGER, referer VARCHAR, useragent\n    VARCHAR) WITH FIELDS IDENTIFIED BY '^(?P\u003cip\u003e\\\\S+)\\\\s(?P\u003ccol2\u003e\\\\S+)\\\\s(?P\u003ccol3\u003e\\\\S+)\\\\s\\\\[(?P\u003cdt\u003e[\\\\w:\\\\/]+\\\\s[+\\\\-]\\\\d{4})\\\\]\\\\s\"(?P\u003cmethod\u003e\\\\S+)\\\\s?(?P\u003curl\u003e\\\\S+)?\\\\s?(?P\u003cversion\u003e\\\\S+)?\"\\\\s(?P\u003cresponse\u003e\\\\d{3}|-)\\\\s(?P\u003csize\u003e\\\\d+|-)\\\\s?\"?(?P\u003creferer\u003e[^\"]*)\"?\\\\s?\"?(?P\u003cuseragent\u003e[^\"]*)?\"?$'\n    LINES TERMINATED BY '\\n';\n```\n\n## Prometheus Exporter\n\nYou can export queries as Prometheus metrics and visualize them on a grafana. (This was not the original idea of the tool but it happened to be good to have at the end).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfleury%2Fgstreamtop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfleury%2Fgstreamtop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfleury%2Fgstreamtop/lists"}