{"id":38028190,"url":"https://github.com/jdrews/go-tailer","last_synced_at":"2026-01-16T19:36:45.085Z","repository":{"id":169254279,"uuid":"645169550","full_name":"jdrews/go-tailer","owner":"jdrews","description":"go-tailer is a Go library designed to help you tail files in a similar fashion to tail -f","archived":false,"fork":false,"pushed_at":"2025-11-25T03:29:58.000Z","size":2435,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-28T13:13:56.786Z","etag":null,"topics":["follow","go","golang","golang-library","log","logfile","logs","tail","tailing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdrews.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-25T04:34:17.000Z","updated_at":"2025-11-25T03:29:55.000Z","dependencies_parsed_at":"2024-03-15T01:55:37.903Z","dependency_job_id":"6f3d18e3-0cc1-4a52-870b-3a1512af65ad","html_url":"https://github.com/jdrews/go-tailer","commit_stats":null,"previous_names":["jdrews/go-tailer"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jdrews/go-tailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrews%2Fgo-tailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrews%2Fgo-tailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrews%2Fgo-tailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrews%2Fgo-tailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdrews","download_url":"https://codeload.github.com/jdrews/go-tailer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrews%2Fgo-tailer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["follow","go","golang","golang-library","log","logfile","logs","tail","tailing"],"created_at":"2026-01-16T19:36:44.340Z","updated_at":"2026-01-16T19:36:45.076Z","avatar_url":"https://github.com/jdrews.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ![image](https://raw.githubusercontent.com/jdrews/logstation/master/web/public/favicon-32x32.png)  go-tailer #\n\ngo-tailer is a Go library designed to help you tail files in a similar fashion to `tail -f`   \n  \n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/jdrews/go-tailer)](https://pkg.go.dev/github.com/jdrews/go-tailer)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=jdrews_go-tailer\u0026metric=security_rating)](https://sonarcloud.io/project/overview?id=jdrews_go-tailer)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jdrews/go-tailer)](https://goreportcard.com/report/github.com/jdrews/go-tailer)\n![Build/Test](https://github.com/jdrews/go-tailer/actions/workflows/build-test.yml/badge.svg)\n\n\nBuilt off the wonderful work by [@fstab](https://github.com/fstab) in the [grok_exporter/tailer module](https://github.com/fstab/grok_exporter/tree/master/tailer).\n\nSee the [FOSDEM17: Implementing 'tail -f'](https://www.youtube.com/watch?v=oc_iJXmUmrA) presentation for how go-tailer works.\n\n# Usage\n## Basic Usage: File Tailer\nHere's a basic example of how to use this library to tail log files. \n```go\npath := \"/var/log/messages\" // a single file\npath := \"/usr/local/myapp/logs/\" // a directory\npath = \"C:\\\\Program Files\\\\MyApp\\\\logs\\\\*.log\" // or a file wildcard\n\n// parse the path glob\nparsedGlob, err := glob.Parse(path)\nif err != nil {\n    panic(fmt.Sprintf(\"%q: failed to parse glob: %q\", parsedGlob, err))\n}\n\n// startup a logrus logger\nlogger := logrus.New()\n\n// startup the file tailer. RunFileTailer can take many path globs\ntailer, err := fswatcher.RunFileTailer([]glob.Glob{parsedGlob}, false, true, logger)\n\n// listen to the go channel for captured lines and do something with them\nfor line := range tailer.Lines() {\n    // line.Line contains the line contents\n    // line.File contains the name of the file that the line was grabbed from\n    DoSomethingWithLine(line.File, line.Line)\n}\n```\n\n## Polling Tailer\nWe recommend using the [RunFileTailer](https://github.com/jdrews/go-tailer/blob/6f5ab8f01f5db115fcb1bd72fdea19205a364910/fswatcher/fswatcher.go#L98), which listens for file system events to trigger tailing actions. But if that isn't working for you, you can fall back to a polling listener to periodically read the file for any new log lines. \n```go\n// specify how often you want the tailer to check for updates\npollInterval := time.Duration(500 * time.Millisecond)\n\n// startup the polling file tailer\ntailer, err := fswatcher.RunPollingFileTailer([]glob.Glob{parsedGlob}, false, true, pollInterval, logger)\n\n// listen to the go channel for captured lines and do something with them\nfor line := range tailer.Lines() {\n    DoSomethingWithLine(line.File, line.Line)\n}\n```\n\n## Other Tailers\nAlong with reading from files, go-tailer can read from other sources as well.\n* Tail stdin (console/shell/standard input): [RunStdinTailer](https://github.com/jdrews/go-tailer/blob/main/stdinTailer.go)\n* Tail a Kafka stream: [RunKafkaTailer](https://github.com/jdrews/go-tailer/blob/main/kafkaTailer.go)\n* Tail a webhook: [WebhookTailer](https://github.com/jdrews/go-tailer/blob/main/webhookTailer.go)\n\n# Frequently Asked Questions (FAQ)\n### Why was the tailer module forked from [fstab/grok_exporter](https://github.com/fstab/grok_exporter) and moved here? \ngrok_exporter had not been updated for 3-4 years and seems to be abandoned by [@fstab](https://github.com/fstab). It also was suffering [from quite a few security issues (CVEs) ](https://deps.dev/go/github.com%2Ffstab%2Fgrok_exporter/v0.2.8), which I've fixed. Additionally, the tailer module was not well known, had poor documentation, and I thought a separate repo would shed some well deserved light on it.   \n   \nI'd welcome making upstream patches to [fstab/grok_exporter](https://github.com/fstab/grok_exporter) if/when it becomes active again! \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdrews%2Fgo-tailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdrews%2Fgo-tailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdrews%2Fgo-tailer/lists"}