{"id":15517273,"url":"https://github.com/skx/asql","last_synced_at":"2025-04-23T03:50:26.962Z","repository":{"id":45035283,"uuid":"156089873","full_name":"skx/asql","owner":"skx","description":"A toy utility to process Apache log files via SQL.","archived":false,"fork":false,"pushed_at":"2022-01-13T04:13:11.000Z","size":171,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-24T12:07:31.107Z","etag":null,"topics":["acc","apache","perl","sqlite","sqlite3"],"latest_commit_sha":null,"homepage":"https://steve.fi/Software/asql/","language":"Perl","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/skx.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":"2018-11-04T14:20:46.000Z","updated_at":"2025-02-10T08:42:07.000Z","dependencies_parsed_at":"2022-09-10T20:22:54.131Z","dependency_job_id":null,"html_url":"https://github.com/skx/asql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skx%2Fasql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skx%2Fasql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skx%2Fasql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skx%2Fasql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skx","download_url":"https://codeload.github.com/skx/asql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241960800,"owners_count":20049340,"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":["acc","apache","perl","sqlite","sqlite3"],"created_at":"2024-10-02T10:12:19.615Z","updated_at":"2025-03-05T03:31:05.122Z","avatar_url":"https://github.com/skx.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"Homepage:\n    http://www.steve.org.uk/Software/asql/\n\nGit Repository:\n    http://github.com/skx/asql/\n\n\nasql\n----\n\nASQL is a simple tool to allow you to query Apache common logfiles\nvia SQL. (Only \"Apache common\" logfiles are currently supported.)\n\nWhen asql starts up it creates a temporary SQLite database to hold\nthe contents of the parsed logfile(s) you might load.  This temporary\ndatabase may then be queried directly via SQL.\n\nWhy might you want to do this?  Well it does allow you to make certain\nqueries very easily.\n\n\nAliases\n-------\n\nUsing the 'alias' command you may record and replay previous\nqueries by name, along with variable expansion.\n\nFor example the following query will show the number of hits\nagainst your server:\n\n     SELECT COUNT(id) FROM logs;\n\nYou could save this query via this:\n\n     ALIAS hits SELECT COUNT(id) FROM logs;\n\nNow at any future point entering 'hits' would run the query.\n\nIf you wish you can use variables in aliases such as:\n\n     ALIAS hitsagent SELECT * FROM logs where agent like '%$1%';\n\nThe text `$1` will be replaced by the first argument you supply to the alias when running it:\n\n     hitsagent mozilla\n     hitsagent Slurp\n\nYou can use variables from $1 to $9.\n\n(Aliases persist between sessions via the file `~/.asql.aliases`.)\n\n\nExample Queries\n---------------\n\nThe following examples give an idea of the kind of power an SQL query allows you:\n\nGreediest downloaders:\n\n     SELECT source,SUM(size) AS Number FROM logs GROUP BY source ORDER BY Number DESC, source\n\nA count of each distinct referers:\n\n     SELECT referer,COUNT(referer) AS number from logs WHERE referer NOT LIKE '%steve.org.uk%' GROUP BY referer ORDER BY number DESC,referer LIMIT 0,10\n\n\nSee which Debian packages were downloaded the most:\n\n     SELECT request,COUNT(request) AS Number FROM logs WHERE request LIKE '%.deb' GROUP BY request ORDER BY Number DESC, request;\n\n\nSee who has downloaded me:\n\n      select * FROM logs WHERE request='/etch/pool/main/a/asql/asql_0.6-1_all.deb';\n\n\nDependencies\n------------\n\nFor parsing IPv6 log entries the `Regexp::IPv6` module is required.\n\n\nSteve\n--\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskx%2Fasql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskx%2Fasql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskx%2Fasql/lists"}