Manual for Smart-Tail 1.1 beta
Content
Sorry, the manual is under construction.
The table of contents is a would be table of contents
Please ignore the table of contents and simply look through the manual and see want you can find.
...
...
...
...
...
...
...
...
...
Handling
-
Both programm window (graphical user interface) and command line.
Drag'n Drop of files or directories with a filter, progress bars
and all this stuff.
-
Analysing ability what search expression or search result
was found how often and where
-
Suspend / Resume of single or all files.
-
Status of every file, e.g "found", "retry", "tailing",...
-
Working with configurations (start, export, import).
The programm uses configurations stored in files.
Filtering with search expressions.
(This was the original intend to develop this programm.)
-
Filtering with regular expressions. This implies "OR".
-
Filtering with "AND".
-
Searching over more than one line.
-
Searching between timestamps.
(Provided there are timestamps in the files.)
-
"Dynamic" search.
The progamm finds a search expression in one file and sends the result
to a 2nd file. From this moment on the programm searches in the
2nd file for that expression. (To be accurate it appends the
new search expression with "AND" to the 2nd file.)
Remark
A regular (search) expression is not neccesserily idendical with
it's result. A regular expression can be something like "hello" but
something like "\p{Upper}{2}\d{4}" too - 2 uppercase characters followed
by 4 numeric characters (example "AB1212").
If you are new and want to see a quick result...
-
Drag'n Drop files or directories into the programm window.
(There is a filter available that is switched off by default.)
-
Optional: Type a search expression in the list "Search Expression".
(You can use regular expressions and a "AND"-sign for "AND". Note the
"Regular-Expression Assistant" under menu "Tools".)
-
Press Button "Start Tail" to start the tailing.
This outputs the last 10 lines of each file by default and outputs
more as the files are growing.
Unix-Tail option -n is set to 10
The last 10 lines of each file are shown. More lines of a file are
shown as the file is growing.
Unix-Tail option -q is not set
Quite is not set. File headers are shown.
Unix-Tail option -r is set
Retry is set. If a file is not found the programm tries again and again
to find and open it.
Unix-Tail option -s is set to 500
Sleep is set to 500 millisecond. It is the intervall the progamm
uses to check wether a file has grown.
The programm uses the regular expression implementation and
synthax of java 1.4 and higher.
The two locations to give the search expressions are:
-
The textfield (list) in the toolbar of the main window.
The last used expressions are shown as history.
-
"Settings Dialog" under menu "Tail"
Regular expressions have a build-in support for "OR".
-
The syntax is "|".
-
Example for a regular expression: "Oktoberfest|Munich"
-
Example for a text to search: "This year at the Oktoberfest the beer consume..."
-
Search is successfull because the text contains "Oktoberfest".
Regular expressions do not have a build-in support for "AND".
Smart-Tail therefor provides an own implementation for your convenience.
Two ways to give the search expressions:
-
The "Settings Dialog": Use the list and the button "AND".
Each item in the list must be found in the text to search.
-
The textfield (list) in the toolbar of the main window.
Use " AND ". Watch the spaces befor and after the "AND".
An example:
-
Regular expression: "Oktoberfest AND Munich" (textfield in toolbar).
-
1st text to search: "This year at the Oktoberfest in Munich the beer consume...".
-
Search is successfull because the text contains "Oktoberfest" AND "Munich".
-
2nd text to search: "This year at the Oktoberfest the beer consume..."
-
Search is not successfull because the text contains "Oktoberfest" only.
xxx
xxx
xxx
xxx
The programm can tell what was found
how often and where. Menu "Tail", Dialog "Statistics".
-
What search expressions or search results are found.
-
How often they are found.
-
Where they are found.
The number of found results is limited. Why?
-
Depending on the search expression and the number of filtered files the programm can find
very much results.
-
That much that there is not enough memory available
(RAM). This, of course, depends on your computer too.
The user can set the maximum number of search results. In the Dialog "Statistics"
there is a button "Details...". It opens a dialog "Maximum Number of Results" where the user can set
the maximum number of results.
What will happen if the maximum number of results is reached?.
The programm will not collect the results any longer but it counts
how many results are found. A red label in the Dialog "Statistics" is displayed.
It will tell the user that the maximum number has been reached. Furthermore it
will tell the user the maximum number of results and compares it to the current number of results.
(That one that is higher than the maximum number.)
Note: If a result (for example FileNotFoundException) is found in 2 different files
it is counted as 2 (not 1).
The maximum number of results is not stored in the configuration. Instead it is stored
as user preference on a particular computer.
Errors or exceptions in logfiles.
-
Possible regular (search) expression
"(?i)\w*?exception\w*?|\w*?error\w*?".
-
Finds all words containing "exception" OR "error" ignoring upper and lower case.
-
Finds for example "NumberFormatException" or "UnknownHostError".
The programm can be started in 2 different ways
-
Start with Java Webstart. This is the easiest way. Just click
the start link at http://www.jfellow.net/tail/download.html.
-
Start manually by executing "java -jar tail.jar". See the list of
parameters.
If started manually (java -jar tail.jar) you can set different parameters.
Note: Don't mix up the parameters with the configuration of tail and grep.
The configuration (for tail and grep) is read from and stored in a configuration file.
-
-nogui
Example: java -jar tail.jar -nogui
Start without programm window.
-
-tail or -t
Example: java -jar tail.jar -tail
Start in tail mode. Usefull in combination with "-nogui".
-
-grep or -g
Example: java -jar tail.jar -grep
Start in grep mode. Usefull in combination with "-nogui".
-
-verbose or -v
Example: java -jar tail.jar -verbose
Starts and prints the configruation.
-
-file or -f
Example: java -jar tail.jar -file=c:/tail.props
Loads the configuration (for "Tail" and "Grep") from a file at startup.
Otherwise the programm loads the last used configuration.
Default is: {user.home}/smarttail/config/Default Configuration.props
-
-logfile
Example: java -jar tail.jar -logfile=c:/tail.log
The progamm will write own messages there. Note this is not the
output of "Tail" or "Grep".
There is allways a default logfile the programm uses:
"{user.home}/smarttail/tail_default.log".
Usefull in combination with "-loglevel".
-
-loglevel
Example: java -jar tail.jar -loglevel=WARNING -logfile=c:/tail.log
See "-logfile". The default is WARNING
Usefull in combination with "-logfile".
Possible values are (sorted by "verbosity"):
OFF
SEVERE
ERROR
WARNING
CONFIG
INFO
FINE
FINER
FINEST
What is this dialog for?
If Smart-Tail finds a certain search expression, lets say "VeryBadException"
it can inform you or execute a command / programm. The actions are:
-
Open a pop-up window
-
Play a sound
-
Send a mail
-
Execute a command
In the action "Mail" and "Command" the following placeholders can be used.
-
{expression} the seach expression of this action
-
{result} result of the search
-
{file} file where the search expression was found
See further down for more on this.
How to use this dialog?
The list "Expressions" can contain several search expressions. Every search expression
can trigger one or more actions:
An example:
-
Press the button "Add".
-
Type a search expression in the textfield "Expression".
This manual contains more on (regular) search expressions: Tips and tricks,
where to find a tutorial and a reference on regular expressions, how to test and
build regular expressions, examples and more.
-
Press "Apply" to add the expression to the list.
-
Choose actions.
The settings in this dialog are included in the current configuration. This means if you
open, close, export, import,... configurations the configurations do not loose the
information about their actions.
The actions are also executed if you start Smart-Tail from the command line.
Checkbox "Actions ON"
If selected the actions are activated.
Checkbox "Sound"
If selected a sound is played every time the action was
executed.
-
{expression} ... inserts the seach expression of this action
-
{result} ... inserts the result of the search
-
{file} ... inserts the file where the search expression was found
Example:
"notepad {file}"
Opens the file with notepad provided you are working
under WINDOWS and notepad is installed.
Example:
net send /domain:computerOfColleque "{file}, {expression}, {result}"
Sends a message to another computer over the network provided you are working
under WINDOWS.
Background knowledge:
System.getRuntime().exec(command) is executed.
Button "..." to the right of checkbox "Command"
Opens a file chooser to search for a programm.
Checkbox "Write Logfiles"
Every command / programm can show messages for the user.
There are two types of messages:
-
Normal messages (std.out) and
-
Error messages (std.err).
You want to try it?
Open a command shell and type: "ping localhost"
Smart tail would write the output of this command to a file.
You find the logfiles in the directory:
{user.home}/smarttail/commandLogs
You will find the value for {user.home} in the dialog
Menu "Help" > "System Info"
Each time a command / programm is executed two logfiles are
created: One for std.out and one for std.err.
All logfiles are deleted if a new "Tail" or "Grep" is started.
|