Readme for analog -- syntax of configuration commands

[ Top | Up | Prev | Next | Map | Index ]

# Analog 6.0: Syntax of configuration commands

This section describes how analog finds configuration commands, and what the syntax of a configuration file should be. The syntax of individual commands is given in the Quick reference section later.

When analog starts up, it first reads options from configuration files and the command line (assuming that you are running analog from an operating system with a command line). Defaults for many of these options will have already been set in the files `anlghead.h` and `anlghea2.h` at the time the program was compiled. So if you compile your own version of analog, rather than downloading a pre-compiled executable, you can also set some options in those files before compiling. Those options are all documented there.

The first file which analog reads is the default configuration file, normally called `analog.cfg`. You can stop this file being read by specifying the option `-G` on the command line. Then the command line arguments are read, in the order in which they appear. Finally, the mandatory configuration file is read, if you specified one when you compiled the program. This is a configuration file which cannot be overridden by the user: if it is not found, analog exits immediately. This allows a system administrator to prevent users analysing certain files or producing certain reports, for example. However, note that the only certain way to prevent users analysing things is to deny them access to the logfile. Otherwise there is nothing to stop them analysing the logfile using another copy of analog or another program.

You can include another configuration file by a command like

    CONFIGFILE other.cfg

The commands in the other configuration file are read immediately, in order. The program then continues reading the first configuration file where it left off. Note that reading in several configuration files does not produce several output pages, but a single output page based on all the options.

You can also include another configuration file from the command line by using a command like `+gother.cfg`. (Note that there is no space between `+g` and the filename; this is true of all command line arguments.) But note that reading an alternative configuration file does not stop the default configuration file (usually `analog.cfg`) being read as well. To do that you have to specify `-G` as well as the `+g` command. This is because if you want several different configurations, it's most convenient to put all the common options in `analog.cfg`, and options specific to each configuration in a separate file. Then the `+g` command line option will read both those files.

If the name of a configuration file given in a `CONFIGFILE` command doesn't include a directory, it will be looked for wherever analog expects to find its configuration files. (This location is a compile-time option.) For example, in the Windows version it would be in the same folder as the analog executable. This applies to the default and mandatory configuration files as well. But configuration files given with `+g` are relative to the current directory at the time you run the program.

In the Mac version, you can start up a program with a particular configuration file instead of the default one by dragging the configuration file onto the analog icon. The file must start with "`#` ".

You can also specify any configuration command on the command line even if it doesn't have a command line abbreviation, by use of the `+C` command. (NB The `C` must be upper case.) For example, `+C"UNCOMPRESS *.gz gzcat"` will include that command.

Here are the syntax rules for configuration commands. A configuration file contains several commands, normally on separate lines; any text after a hash (`#`) on a line is ignored as a comment. Configuration commands can be continued across lines by using a backslash as the last character on the line (but can't then have comments until the end of all the lines; also the total length can't be more than 254 characters). Each command consists of the command name followed by one or two arguments. An argument to a command may optionally be placed in single or double quotes or parentheses, and it must be if the argument contains a hash or a space, or if the last character of the last argument is a backslash. So, for example, here are some valid configuration commands.

    DAILYSUM   OFF   # We don't want a Daily Summary
    DAILYREP  "ON"   # We want a full Daily Report instead
    HOSTNAME (Spam Widgets Inc.)  # Spaces, so quotes or brackets needed
    LOGFILE logfile1.log,\
    logfile2.log     # This line and the previous one are one command

Generally later commands override earlier ones if you can have only one of that thing (e.g., for the `OUTFILE`), or supplement them if you can have several (e.g., for the `LOGFILE`, because you can read several logfiles). Apart from that, the order of commands doesn't matter, except that `LOGFORMAT` and `LOGTIMEOFFSET` commands must come earlier in the same configuration file than the `LOGFILE` to which they refer.

If all the options seem a bit confusing, just run

    analog -settings [other options]

from the command line, or include `SETTINGS ON` in the configuration commands. Then instead of running normally, analog will just tell you what the values of all the variables will be, based on the defaults in `anlghead.h` and `anlghea2.h`, the configuration commands, and the command line options. If you're on Unix or Windows, remember that you can send the output to a file with

    analog -settings > file

Also, `analog -version` will just give the version number.

Go to the analog home page.

Need help with analog? Use the analog-help mailing list.

[ Top | Up | Prev | Next | Map | Index ]