ASQL(8)

πŸ“¦
version 1.7 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ 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 ~/.asqlrc if 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