{"id":18593937,"url":"https://github.com/janstuemmel/cs2-log","last_synced_at":"2025-07-27T01:04:22.964Z","repository":{"id":176141336,"uuid":"652727211","full_name":"janstuemmel/cs2-log","owner":"janstuemmel","description":"Go package for parsing cs2 server logfiles","archived":false,"fork":false,"pushed_at":"2023-11-24T18:33:31.000Z","size":69,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T02:59:57.595Z","etag":null,"topics":["counter-strike","cs2","go","golang"],"latest_commit_sha":null,"homepage":"","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/janstuemmel.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":"2023-06-12T17:08:01.000Z","updated_at":"2025-01-22T21:29:08.000Z","dependencies_parsed_at":"2023-11-24T19:30:08.329Z","dependency_job_id":null,"html_url":"https://github.com/janstuemmel/cs2-log","commit_stats":null,"previous_names":["janstuemmel/cs2-log"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/janstuemmel/cs2-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janstuemmel%2Fcs2-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janstuemmel%2Fcs2-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janstuemmel%2Fcs2-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janstuemmel%2Fcs2-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janstuemmel","download_url":"https://codeload.github.com/janstuemmel/cs2-log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janstuemmel%2Fcs2-log/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267278631,"owners_count":24063252,"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-07-26T02:00:08.937Z","response_time":62,"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":["counter-strike","cs2","go","golang"],"created_at":"2024-11-07T01:14:00.174Z","updated_at":"2025-07-27T01:04:22.916Z","avatar_url":"https://github.com/janstuemmel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cs2-log\n\nGo package for parsing cs2 server logfiles. It exports types for cs2 logfiles, their regular expressions, a function for\nparsing and a function for converting to non-html-escaped JSON.\n\n## Usage\n\nFor more examples look at the [tests](./cs2log_test.go) and the command-line utility in [examples folder](./example).\nHave also a look at [godoc](http://godoc.org/github.com/janstuemmel/cs2-log).\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/janstuemmel/cs2-log\"\n)\n\nfunc main() {\n\n\tvar msg cs2log.Message\n\n\t// a line from a server logfile\n\tline := `L 11/05/2018 - 15:44:36: \"Player\u003c12\u003e\u003c[U:1:29384012]\u003e\u003cCT\u003e\" purchased \"m4a1\"`\n\n\t// parse into Message\n\tmsg, err := cs2log.Parse(line)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(msg.GetType(), msg.GetTime().String())\n\n\t// cast Message interface to PlayerPurchase type\n\tplayerPurchase, ok := msg.(cs2log.PlayerPurchase)\n\n\tif ok != true {\n\t\tpanic(\"casting failed\")\n\t}\n\n\tfmt.Println(playerPurchase.Player.SteamID, playerPurchase.Item)\n\n\t// get json non-htmlescaped\n\tjsn := cs2log.ToJSON(msg)\n\n\tfmt.Println(jsn)\n}\n```\n\nExample JSON output:\n\n```json\n{\n  \"time\": \"2018-11-05T15:44:36Z\",\n  \"type\": \"PlayerPurchase\",\n  \"player\": {\n    \"name\": \"Player\",\n    \"id\": 12,\n    \"steam_id\": \"[U:1:29384012]\",\n    \"side\": \"CT\"\n  },\n  \"item\": \"m4a1\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanstuemmel%2Fcs2-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanstuemmel%2Fcs2-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanstuemmel%2Fcs2-log/lists"}