Power User Techniques

This page describes some of the faster, more powerful, and less intuitive ways of using Sawmill. Power users may find themselves using these techniques, rather than the friendlier but slower graphical interface. These techniques involve direct editing of Sawmill text-based profile options, and will be most easily mastered by users already comfortable with command line programs. You may want to familiarize yourself with the Configuration Options before reading this page.

Using Sawmill from the Command Line

Sawmill can be directly invoked from the command line (see The Command Line).

For instance, you may prefer to build and update your profile databases from the command line, avoiding the overhead of the web interface. To rebuild a profile database from the command line, do this:

  sawmill -p {profile-name} -a bd
(replacing {profile-name} with the name of your profile), or update it using
  sawmill -p {profile-name} -a ud
p is short for profile; see Profile to use. cm is short for action. You can then browse that database from the web browser interface. If you'd prefer to generate offline HTML for the profile, you can do this:
  sawmill -p {profile-name} -a grf -rn {reportname}

You can add any options to the command line that you can add to a profile file (and vice versa), so the Sawmill command line provides a great deal of flexibility. See Configuration Options for information on the available options.

Many command-line actions are available, including CSV export, HTML file generation, HTML email, and actions to build a database in stages. See Action for a list of all available actions.

Creating and Editing Profile Files

Sawmill stores profile options in profile files (see Configuration Files), in the profiles directory of the LogAnalysisInfo directory.

Profile files are structured in groups of options, with subgroups inside some groups. For instance, a profile might start like this (for simplicity, only some options are listed):

myprofile = {
  database = {
    options = {
      database_type = "internal"
      automatically_update_when_older_than = "0"
      lock_database_when_in_use = "true"
      prompt_before_erasing_database = "true"
    } # options
    tuning = {
      hash_table_starting_size = "4096"
      hash_table_expansion_factor = "2"
    } # tuning
  } # database

This profile is named "myprofile", and the first group shown the database group, containing all database options for the profile. Within that group, there are groups for database options ("options") and database tuning ("tuning"). You can edit this file with a text editor to change who the profile does -- all options available in the graphical interface are also available by editing the text file. Some advanced users do most of their profile editing with a text editor, rather than using the graphical interface. Advanced users also often write scripts which edit or create profile files automatically, and then call Sawmill using the command line to use those profiles.

Of course, you can still edit the profile from the graphical interface whenever you want, even to make modifications to profiles you have changed with a text editor. However, Sawmill's web browser interface will recreate the profile file using its own formatting, so don't use it if you've added your own comments or changed the text formatting!

Overriding Profile Options from the Command Line

On the command line, you can modify these options by listing the groups, separated by dots. For instance, if you wanted to use a hash table size of 8192, you could add this to the command line:

  -database.tuning.hash_table_starting_size 8192

Command line options are listed with a dash followed by the name or shortcut of the option; followed by a space and the option value. Any profile options can be overridden in this way. Command-line overrides persist only for the duration of that command-line action -- they do not result in permanent modifications of the profile file.