IBM Tivoli Composite Application Manager for Application Diagnostics, Version 7.1.0.1
Troubleshooting
Boolean operators require parentheses. The following example demonstrates the strictness of boolean evaluation:
viewer -q "select default where (server = 'joe') AND (element = 'trace') AND (messageID='FRWEP0001E')"
This results in the following error:
2002.04.10 14:52:19.755 com.tivoli.log.viewer.QueryTree labels Tivoli IVR 1 log viewer wintest2.dev.tivoli.com IP IVR0019E unexpected character after query: AND
The solution is to ensure that each boolean expression has the form "(expression) OR (expression)" or "(expression) AND (expression)". So in this case, we could change the example to:
viewer -q "select default where ((server = 'joe') AND (element = 'trace')) AND (messageID = 'FRWEP0001E')"
Use quotes in the query string: The following example attempts to make a query using the MATCH operator, but the query string is not delimited by double quotes:
viewer.sh -qselect default where logText match ^get *.xml
This results in the following error:
2002.03.29 14:21:47.014 com.tivoli.log.viewer.QueryTree labels Tivoli IVR 1 log viewer aix102.dev.tivoli.com IP IVR0017E missing column label
When a query is incomplete, LogViewer issues an error to indicate which component of the query string was found to be missing. In this example it was expecting to find a column label, but the string terminated. Without double quotes around the query string, the shell provides each word of the query in a different argument, resulting in the string appearing as "select". We can correct the situation by adding double quotes around the query string like so:
viewer.sh -q "select default where logText match ^get" *.xml
Upon running this corrected query, we get the following error:
2002.03.29 14:18:53.423 (null) main Tivoli IVR 1 log viewer jrowlan2.dev.tivoli.com IP IVR0021E Invalid character ^ found in query string.
The query syntax allows values to be enclosed in single quotes, which signal to the viewer that the string inside the single quote need not be parsed:
viewer.sh -q "select default where logText match '^get'" *.xml
Single quotes are also required if the term contains spaces. Directory names and file names occasionally contain spaces. Since the viewer accepts space-separated file names, this creates ambiguity. The following could be interpreted either as two separate files , "a" and "b/c", or as a single file, "c", in subdirectory "a b":
viewer a b/c
To resolve this, use quotes around any file name that contains spaces. For example:
viewer "a b/c"
...identifies a file named "c" in subdirectory "a b", whereas
viewer a b/c
...identifies two files, "a" and "c in subdirectory b".