{"id":17569107,"url":"https://github.com/riywo/fluent-plugin-groupcounter","last_synced_at":"2025-10-10T10:07:29.147Z","repository":{"id":4795243,"uuid":"5948075","full_name":"riywo/fluent-plugin-groupcounter","owner":"riywo","description":null,"archived":false,"fork":false,"pushed_at":"2014-08-03T13:56:48.000Z","size":238,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-23T05:39:23.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/riywo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-25T10:03:17.000Z","updated_at":"2017-02-09T08:07:02.000Z","dependencies_parsed_at":"2022-08-18T00:20:57.687Z","dependency_job_id":null,"html_url":"https://github.com/riywo/fluent-plugin-groupcounter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/riywo/fluent-plugin-groupcounter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riywo%2Ffluent-plugin-groupcounter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riywo%2Ffluent-plugin-groupcounter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riywo%2Ffluent-plugin-groupcounter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riywo%2Ffluent-plugin-groupcounter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riywo","download_url":"https://codeload.github.com/riywo/fluent-plugin-groupcounter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riywo%2Ffluent-plugin-groupcounter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001315,"owners_count":26083059,"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-10-09T02:00:07.460Z","response_time":59,"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":[],"created_at":"2024-10-21T17:09:25.010Z","updated_at":"2025-10-10T10:07:29.129Z","avatar_url":"https://github.com/riywo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-plugin-groupcounter, a plugin for [Fluentd](http://fluentd.org)\n\nFluentd plugin to count like SELECT COUNT(\\*) GROUP BY.\n\n## Configuration\n\nAssume inputs are coming as followings:\n\n    apache.access: {\"code\":\"200\", \"method\":\"GET\", \"path\":\"/index.html\", \"reqtime\":\"1.001\" }\n    apache.access: {\"code\":\"202\", \"method\":\"GET\", \"path\":\"/foo.html\",   \"reqtime\":\"2.002\" }\n    apache.access: {\"code\":\"200\", \"method\":\"GET\", \"path\":\"/index.html\", \"reqtime\":\"3.003\" }\n\nThink of quering `SELECT COUNT(\\*) GROUP BY code,method,path`. Configuration becomes as below:\n\n    \u003cmatch apache.access\u003e\n      type groupcounter\n      aggregate tag\n      output_per_tag true\n      add_tag_prefix groupcounter\n      group_by_keys code,method,path\n    \u003c/match\u003e\n\nOutput becomes like\n\n    groupcounter.apache.access: {\"200_GET_/index.html_count\":2, \"202_GET_/foo.html_count\":1}\n\n## Parameters\n\n* group\\_by\\_keys (semi-required)\n\n    Specify keys in the event record for grouping. `group_by_keys` or `group_by_expression` is required.\n\n* delimiter\n\n    Specify the delimiter to join `group_by_keys`. Default is '_'.\n\n* pattern\\[1-20\\]\n\n    Use `patternX` option to apply grouping more roughly. For example, adding a configuration for the above example as below\n\n         pattern1 2xx ^2\\d\\d\n\n    gives you an ouput like\n\n         groupcounter.apache.access: {\"2xx_GET_/index.html_count\":3}\n\n* group\\_by\\_expression (semi-required)\n\n    Use an expression to group the event record. `group_by_keys` or `group_by_expression` is required.\n\n    For examples, for the exampled input above, the configuration as below\n\n        group_by_expression ${method}${path}/${code}\n\n    gives you an output like\n\n        groupcounter.apache.access: {\"GET/index.html/200_count\":1, \"GET/foo.html/400_count\":1}\n\n    SECRET TRICK: You can write a ruby code in the ${} placeholder like\n\n        group_by_expression ${method}${path.split(\".\")[0]}/${code[0]}xx\n\n    This gives an output like\n\n        groupcounter.apache.access: {\"GET/index/2xx_count\":1, \"GET/foo/4xx_count\":1}\n\n* tag\n\n    The output tag. Default is `groupcount`.\n\n* add\\_tag\\_prefix\n\n    The prefix string which will be added to the input tag. `output_per_tag yes` must be specified together. \n\n* remove\\_tag\\_prefix\n\n    The prefix string which will be removed from the input tag.\n\n* count\\_interval\n\n    The interval time to count in seconds. Default is `60`.\n\n* unit\n\n    The interval time to monitor specified an unit (either of `minute`, `hour`, or `day`).\n    Use either of `count_interval` or `unit`.\n\n* store\\_file\n\n    Store internal data into a file of the given path on shutdown, and load on starting.\n\n* max\\_key\n\n    Specify key name in the event record to do `SELECT COUNT(\\*),MAX(key_name) GROUP BY`.\n\n    For examples, for the exampled input above, adding the configuration as below\n\n        max_key reqtime\n\n    gives you an output like\n\n        groupcounter.apache.access: {\"200_GET_/index.html_reqtime_max\":3.003, \"202_GET_/foo.html_reqtime_max\":2.002}\n\n* min\\_key\n\n    Specify key name in the event record to do `SELECT COUNT(\\*),MIN(key_name) GROUP BY`.\n\n* avg\\_key\n\n    Specify key name in the event record to do `SELECT COUNT(\\*),AVG(key_name) GROUP BY`.\n\n* count\\_suffix\n\n    Default is `_count`\n\n* max\\_suffix\n\n    Default is `_max`. Should be used with `max_key` option.\n\n* min\\_suffix\n\n    Default is `_min`. Should be used with `min_key` option.\n\n* avg\\_suffix\n\n    Default is `_avg`. Should be used with `avg_key` option.\n\n## ChangeLog\n\nSee [CHANGELOG.md](CHANGELOG.md) for details.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new [Pull Request](../../pull/new/master)\n\n## Copyright\n\n* Copyright\n  * Copyright (c) 2012- Ryosuke IWANAGA (riywo)\n  * Copyright (c) 2013- Naotoshi SEO (sonots)\n* License\n  * Apache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friywo%2Ffluent-plugin-groupcounter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friywo%2Ffluent-plugin-groupcounter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friywo%2Ffluent-plugin-groupcounter/lists"}