ASQL(8)
β¨ ASQL(8) β¨
okay bestie, welcome to the Perl Programmers Reference Guide page for asql, and honestly? she's iconic. π
πΈ NAME πΈ
asql β provides a simple console interface that lets you query the contents of an Apache logfile through an SQL interface. no cap. π¦
π SYNOPSIS π
asql [options]
General Options:
--help Show brief help intstructions.
--manual Show more complete help.
--version Show the version of the software.
Scripting Options:
--load Load the named file, or glob.
--execute Execute a single query then exit.
Options:
--file Rather than running as a shell read commands from a named file.
--quiet Don't show the banner at startup.
and because we love a breakdown, here's the same thing but explained, one by one π«Ά
general options
--helpβ shows you the brief help intstructions. (yes, "intstructions". that's literally how it's spelled in the source. not me, bestie. π)--manualβ shows the more complete help. the whole lore. π--versionβ shows you which version of the software you're on. vibe check on the build. β¨
scripting options
--loadβ loads the named file, or a glob. π--executeβ runs a single query and then exits. one and done, main character energy π
options
--fileβ instead of running as a shell, it reads commands from a named file. π--quietβ don't show the banner at startup. no intro, straight to business. π€«
π¦ DESCRIPTION π¦
asql gives you a simple console interface so you β a real human β can query the contents of an Apache logfile through an SQL interface. it's giving "logfiles but make it queryable". π
the shell features include:
- Persistent alias definitions.
- Command line completion.
- Command history.
- Simple scriptability.
like. the way that it just has all of that. obsessed. π₯
π INTRODUCTION π
okay so here's the whole situation, bestie:
the asql shell creates a temporary SQLite database</> based on any number of Apache logfiles. then you can interactively query that temporary database using common SQL syntax. it's literally that easy. β
to get started you should load your logfiles into the database:
load /var/log/apache2/acces*
(the tool will automatically decompress files which have been compressed with gzip or bzip2. she handles it. π§)
once you've loaded at least one file you may run queries, for example:
SELECT source,COUNT(id),SUM(size) AS Number FROM logs GROUP BY source ORDER BY Number DESC, source
this example will show the number of requests each distinct IP address has made, along with the total size of the files they've requested. π
as you can see, we've selected three columns: "source", COUNT(id), and "SUM(size)". and you can see which other columns are available via the "show" command. π
and because parsing the Apache logfile(s) you specified might be quite slow, there's the option of dumping the temporary SQLite database to a known filename with the 'save' command. the analog to the save command is the 'restore' command, which will read in an existing SQLite database and let future queries be executed against it. symmetrical queens. π―
π FILES π
- when the shell starts up, it will read and intepret the initialisation file of
~/.asqlrcif it exists. any commands present in that file will be executed prior to the launch of the interactive session. π - all aliases will be read and written to the file
~/.asql.aliases. π - all interactive history will be written to the file
~/.asql. π°οΈ
π«Ά AUTHOR π«Ά
Steve
--
http://www.steve.org.uk/
π LICENSE π
Copyright (c) 2007,2008,2009,2010,2011 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.
π«Ά AUTHOR π«Ά
Steve
--
http://www.steve.org.uk/
π LICENSE π
Copyright (c) 2007-2011 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.
aaaand that's the whole page, bestie π this one's from perl v5.40.1, dated 2026-01-13, and it ate. no crumbs left. periodt. π
β¨π
π¦ where this page comes from
- ubuntu resolute: asql 1.7-1build1 Β· Perl
- ubuntu stonking: asql 1.7-1build1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms