{"id":27088948,"url":"https://github.com/devops-works/telegraf-tailcount","last_synced_at":"2025-10-24T07:40:39.518Z","repository":{"id":61938456,"uuid":"556396403","full_name":"devops-works/telegraf-tailcount","owner":"devops-works","description":"Counts new lines in growing file and return InfluxDB metrics on STDOUT.","archived":false,"fork":false,"pushed_at":"2022-10-23T20:23:55.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-21T08:24:47.721Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devops-works.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}},"created_at":"2022-10-23T18:59:43.000Z","updated_at":"2022-10-23T19:00:58.000Z","dependencies_parsed_at":"2022-10-23T21:15:15.160Z","dependency_job_id":null,"html_url":"https://github.com/devops-works/telegraf-tailcount","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Ftelegraf-tailcount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Ftelegraf-tailcount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Ftelegraf-tailcount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Ftelegraf-tailcount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devops-works","download_url":"https://codeload.github.com/devops-works/telegraf-tailcount/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445686,"owners_count":20939953,"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":[],"created_at":"2025-04-06T06:36:43.715Z","updated_at":"2025-10-24T07:40:39.425Z","avatar_url":"https://github.com/devops-works.png","language":"Go","readme":"# telegraf tailcount\n\nCounts lines in growing file and return metrics on STDOUT.\n\nUse with [`execd`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/execd) plugin.\n\n## Why ?\n\nMainly because apache ReqPerSec from mod_status is totally [useless](https://stackoverflow.com/questions/4630654/apache2-server-status-reported-value-for-requests-sec-is-wrong-what-am-i-doi).\n\n## Usage\n\n### Invocation\n\n```\nUsage: telegraf-tailcount [options] file\nOptions:\n  -i int     Interval in seconds (default 10)\n  -p int     Peak interval in seconds (default 1)\n  -m string  Measurement name (default 'tailcount')\n  -t string  Comma-separated k=p pairs for tags (default 'file=\u003cfile\u003e')\n```\n\ne.g.:\n\n```\n$ telegraf-tailcount -t foo=bar -i 10 -p 1 /tmp/log\ntailcount,file=/tmp/log,foo=bar sum=31,max=5,min=1\ntailcount,file=/tmp/log,foo=bar sum=35,max=6,min=1\n...\n```\n\n- _Interval_ is the metric output interval on STDOUT.\n- _Peak interval_ is the interval for which telegraf-tailcount will compute min,\n  mean, median and max\n\nSo if you're looking at computing requests per second from an http log file,\nyou'll want _Peak interval_ to be 1.\n\nNote that _Interval_ must be a multiple of _Peak interval_, and both must be\nintegers.\n\n### Telegraf config\n\nThis tool is intended to be used with the \n[`execd` telegraf plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/execd).\n\n```toml\n[[inputs.execd]]\n  command = [\"telegraf-tailcount\", \"-t\", \"foo=bar\", \"-i\", \"10\", \"-p\", \"1\", \"/tmp/log\"]\n\n  # the values below are the defaults and can be omitted\n  signal = \"none\"\n  restart_delay = \"10s\"\n  data_format = \"influx\"\n```\n\n### Metrics\n\n`telegraf-tailcount` outputs the following metrics:\n\n- `sum`: number of lines read during `interval`\n- `max`: maximum of lines read during a `peakInterval`\n- `min`: minimum of lines read during a `peakInterval`\n- `median`: median of lines read during a `peakInterval`\n- `mean`: mean of lines read during a `peakInterval`","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevops-works%2Ftelegraf-tailcount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevops-works%2Ftelegraf-tailcount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevops-works%2Ftelegraf-tailcount/lists"}