{"id":18171359,"url":"https://github.com/aorith/varnishlog-parser","last_synced_at":"2025-12-27T19:26:24.460Z","repository":{"id":260610894,"uuid":"881832621","full_name":"aorith/varnishlog-parser","owner":"aorith","description":"A varnishlog parser library and web user interface","archived":false,"fork":false,"pushed_at":"2025-06-21T12:27:06.000Z","size":552,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T13:32:55.511Z","etag":null,"topics":["golang","templ","varnish","varnishlog"],"latest_commit_sha":null,"homepage":"https://varnishlog.iou.re/","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/aorith.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,"zenodo":null}},"created_at":"2024-11-01T10:34:57.000Z","updated_at":"2025-06-21T12:27:04.000Z","dependencies_parsed_at":"2024-11-01T11:26:00.710Z","dependency_job_id":"bf355881-d5be-4b7b-8f01-4eeb8bdd5f3f","html_url":"https://github.com/aorith/varnishlog-parser","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":"0.10344827586206895","last_synced_commit":"b6c56ea8b0c0c3c15ba5d437785b58d24aaf2eb8"},"previous_names":["aorith/varnishlog-parser"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/aorith/varnishlog-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aorith%2Fvarnishlog-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aorith%2Fvarnishlog-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aorith%2Fvarnishlog-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aorith%2Fvarnishlog-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aorith","download_url":"https://codeload.github.com/aorith/varnishlog-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aorith%2Fvarnishlog-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268322414,"owners_count":24231819,"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-08-01T02:00:08.611Z","response_time":67,"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":["golang","templ","varnish","varnishlog"],"created_at":"2024-11-02T15:08:45.475Z","updated_at":"2025-12-27T19:26:24.455Z","avatar_url":"https://github.com/aorith.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# varnishlog-parser\n\n\u003e Varnishlog Parser is a small Go library built to parse and analyze `varnishlog`\n\u003e output, just like the name suggests.\n\nA frontend to easily parse the logs is implemented using this library.\n\nAn instance is available here: [varnishlog.iou.re](https://varnishlog.iou.re/)\n\n## Use as a library\n\nCheck the reference [documentation](https://pkg.go.dev/github.com/aorith/varnishlog-parser)\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/aorith/varnishlog-parser/assets\"\n\t\"github.com/aorith/varnishlog-parser/vsl\"\n)\n\nfunc main() {\n\tp := vsl.NewTransactionParser(strings.NewReader(assets.VCLCached)) // Replace with your own varnishlog log\n\ttxsSet, err := p.Parse()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\t// Iterate all the transactions VSL log records\n\tfor _, tx := range txsSet.Transactions() {\n\t\tfmt.Printf(\"%v\\n\", tx.TXID)\n\t\tfor _, r := range tx.Records {\n\t\t\tswitch record := r.(type) {\n\t\t\tcase vsl.TimestampRecord:\n\t\t\t\tfmt.Printf(\"  [%s]  %s: %s\\n\", record.GetTag(), record.EventLabel, record.SinceLast.String())\n\t\t\tcase vsl.SessCloseRecord:\n\t\t\t\tfmt.Printf(\"  [%s]  %s: %s\\n\", record.GetTag(), record.Reason, record.Duration.String())\n\t\t\tdefault:\n\t\t\t\tfmt.Printf(\"  [%s]  %s\\n\", record.GetTag(), record.GetRawValue())\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\nOutput:\n\n```\n6-sess\n  [Begin]  sess 0 HTTP/1\n  [SessOpen]  192.168.65.1 61200 http 192.168.50.10 80 1762612268.273411 28\n  [Link]  req 9 rxreq\n  [SessClose]  REM_CLOSE: 111ms\n  [End]\n9-req-rxreq\n  [Begin]  req 6 rxreq\n  [Timestamp]  Start: 0s\n  [Timestamp]  Req: 0s\n  [VCL_use]  boot\n  [ReqStart]  192.168.65.1 61200 http\n  [ReqMethod]  GET\n  [ReqURL]  /item\n  [ReqProtocol]  HTTP/1.1\n\n  [ . . . ]\n\n  [RespHeader]  X-Varnish: 9 8\n  [RespHeader]  Age: 0\n  [RespHeader]  Via: 1.1 4dab8a10025c (Varnish/7.7)\n  [RespHeader]  Accept-Ranges: bytes\n  [VCL_call]  DELIVER\n  [VCL_return]  deliver\n  [Timestamp]  Process: 100µs\n  [Filters]\n  [RespHeader]  Connection: keep-alive\n  [Timestamp]  Resp: 126µs\n  [ReqAcct]  121 0 121 251 304 555\n  [End]\n```\n\nTransactions can be marshaled into JSON:\n\n```go\n\tb, err := json.MarshalIndent(txsSet.Transactions(), \"\", \"  \")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(string(b))\n```\n\nOutput (trimmed for brevity):\n\n```json\n[\n  {\n    \"TXID\": \"4-req-rxreq\",\n    \"VXID\": 4,\n    \"Level\": 1,\n    \"Reason\": \"rxreq\",\n    \"ESILevel\": 0,\n    \"TXType\": \"Request\",\n    \"RawLog\": \"*   \\u003c\\u003c Request  \\u003e\\u003e 4\",\n    \"Records\": [\n      {\n        \"Tag\": \"Begin\",\n        \"RawValue\": \"req 1 rxreq\",\n        \"RecordType\": \"req\",\n        \"Parent\": 1,\n        \"ESILevel\": 0,\n        \"Reason\": \"rxreq\"\n      },\n      {\n        \"Tag\": \"Timestamp\",\n        \"RawValue\": \"Start: 1763030681.497130 0.000000 0.000000\",\n        \"EventLabel\": \"Start\",\n        \"StartTime\": \"2025-11-13T11:44:41.49713+01:00\",\n        \"AbsoluteTime\": \"2025-11-13T11:44:41.49713+01:00\",\n        \"SinceStart\": 0,\n        \"SinceLast\": 0\n      },\n      {\n        \"Tag\": \"Timestamp\",\n        \"RawValue\": \"Req: 1763030681.497130 0.000000 0.000000\",\n        \"EventLabel\": \"Req\",\n        \"StartTime\": \"2025-11-13T11:44:41.49713+01:00\",\n        \"AbsoluteTime\": \"2025-11-13T11:44:41.49713+01:00\",\n        \"SinceStart\": 0,\n        \"SinceLast\": 0\n      },\n      {\n        \"Tag\": \"VCL_use\",\n        \"RawValue\": \"boot\"\n      },\n      {\n        \"Tag\": \"ReqStart\",\n        \"RawValue\": \"192.168.65.1 54660 http\",\n        \"ClientIP\": \"192.168.65.1\",\n        \"ClientPort\": 54660,\n        \"Listener\": \"http\"\n      },\n\n      [ . . . ]\n\n      {\n        \"Tag\": \"RespHeader\",\n        \"RawValue\": \"Age: 0\",\n        \"Name\": \"Age\",\n        \"Value\": \"0\",\n        \"HeaderType\": \"RespHeader\"\n      },\n      {\n        \"Tag\": \"RespHeader\",\n        \"RawValue\": \"Via: 1.1 e088e52945df (Varnish/7.7)\",\n        \"Name\": \"Via\",\n        \"Value\": \"1.1 e088e52945df (Varnish/7.7)\",\n        \"HeaderType\": \"RespHeader\"\n      },\n    ],\n    \"ReqHeaders\": { ... },\n    \"RespHeaders\": { ... },\n    \"Parent\": 1,\n    \"Children\": null\n  }\n]\n```\n\n## Run the web-ui locally\n\nEither clone this repository and run:\n\n```sh\ngo run cmd/server\n```\n\nOr with docker/podman:\n\n```sh\ndocker run --rm -p 8080:8080 ghcr.io/aorith/varnishlog-parser:latest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faorith%2Fvarnishlog-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faorith%2Fvarnishlog-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faorith%2Fvarnishlog-parser/lists"}