{"id":13574384,"url":"https://github.com/vogo/logtail","last_synced_at":"2026-02-15T08:10:12.552Z","repository":{"id":45348049,"uuid":"315640447","full_name":"vogo/logtail","owner":"vogo","description":"logtail is a log tailing utility, support tailing multiple commands output stream, transferring matching content to file/webhook(like dingtalk) ","archived":false,"fork":false,"pushed_at":"2023-07-14T15:04:27.000Z","size":548,"stargazers_count":36,"open_issues_count":0,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-05T09:44:30.583Z","etag":null,"topics":["golang","log","tail","websocket"],"latest_commit_sha":null,"homepage":"http://github.com/vogo/logtail","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/vogo.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":"2020-11-24T13:27:14.000Z","updated_at":"2024-03-20T23:48:50.000Z","dependencies_parsed_at":"2024-01-14T03:51:40.955Z","dependency_job_id":"239596da-b849-47c6-a3bb-adcb79d301a0","html_url":"https://github.com/vogo/logtail","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vogo%2Flogtail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vogo%2Flogtail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vogo%2Flogtail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vogo%2Flogtail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vogo","download_url":"https://codeload.github.com/vogo/logtail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247202550,"owners_count":20900799,"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":["golang","log","tail","websocket"],"created_at":"2024-08-01T15:00:51.123Z","updated_at":"2026-02-15T08:10:07.513Z","avatar_url":"https://github.com/vogo.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# logtail is a log tailing utility.\n\n[![codecov](https://codecov.io/gh/vogo/logtail/branch/master/graph/badge.svg)](https://codecov.io/gh/vogo/logtail)\n[![GoDoc](https://godoc.org/github.com/vogo/logtail?status.svg)](https://godoc.org/github.com/vogo/logtail)\n![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)\n\n## 1. Features\n- tailing command output\n- support watch files under directory/sub-directories\n- support (dynamically) multiple commands tailing\n- support websocket tailing\n- support log matching filter\n- support transfer log to console/file/webhook (include dingtalk)\n\n## 2. Architecture\n\n![](https://github.com/vogo/vogo.github.io/raw/master/logtail/logtail-architecture-v2.png)\n\n## 3. Usage\n\n## 3.2. install logtail\n\n`go install github.com/vogo/logtail@master`\n\n### 3.2. StartLoop logtail server using config file\n\n```bash\nlogtail -file \u003cconfig-file\u003e\n```\n\nconfig file [examples](examples/README.md).\n\n### 3.3. StartLoop logtail server and config using webapi\n\nusage: `logtail -port=\u003cport\u003e`\n```bash\n# start at port 54321\nlogtail -port=54321\n```\nThen config using [web api](webapi/README.md) from web page `http://\u003cserver-ip\u003e:\u003cport\u003e/manage`.\n\nAnd you can browse `http://\u003cserver-ip\u003e:\u003cport\u003e` to list all tailing logs.\n\n## 4. log format\n\nYou can config log format globally, or config it for a server.\n\nThe config `prefix` of the format is the wildcard of the prefix of a new log record,\n`logtail` will check whether a new line is the StartLoop of a new log record, or one of the following lines.\n\nThe wildcard does NOT support '*' for none or many chars, it supports the following tag:\n- '?' as one byte char;\n- '~' as one alphabet char;\n- '!' as one number char;\n- other chars must exact match.\n\nexample:\n```bash\n{\n    \"default_format\":{\n      \"prefix\": \"!!!!-!!-!!\"  # global format config, Matches 2020-12-12\n    },\n    \"servers\": [\n        {\n          \"name\": \"app1\",\n          \"command\": \"tail -f /logs/app/app1.log\",\n          \"format\":{\n            \"prefix\": \"!!!!-!!-!!\" # server format config, Matches 2020-12-12\n          }\n        }\n    ]\n}\n```\n\n## 4. command examples\n\nThe following are some useful commands which can be used in logtail.\n\n```bash\n# tail log file\ntail -f /usr/local/myapp/myapp.log\n\n# k8s: find and tail logs for the single pod of myapp\nkubectl logs --tail 10 -f $(kubectl get pods --selector=app=myapp -o jsonpath='{.items[*].metadata.name}')\n\n# k8s: find and tail logs for the myapp deployment (multiple pods)\nkubectl logs --tail 10 -f deployment/$(kubectl get deployments --selector=project-name=myapp -o jsonpath='{.items[*].metadata.name}')\n\n# k8s: find and tail logs for the latest version of the myapp deployment (single pod)\ns=$(kubectl get deployments --selector=project-name=myapp -o jsonpath='{.items[*].metadata.name}');s=${s##* };kubectl logs --tail 10 -f deployment/$s\n\n# k8s: find and tail logs for the latest version of the myapp deployment (multiple pods)\napp=$(kubectl get deployments --selector=project-name=myapp -o jsonpath='{.items[*].metadata.name}');app=${app##* };pods=$(kubectl get pods --selector=app=$app -o jsonpath='{.items[*].metadata.name}');cmd='';for pod in $pods; do cmd=$cmd'kubectl logs --tail 2 -f pod/'$pod$'\\n'; done;cmd=${cmd::-1}; echo \"$cmd\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvogo%2Flogtail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvogo%2Flogtail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvogo%2Flogtail/lists"}