Create a Complex Query
You select Advanced View from the Simple Query tab to change the tab name to Query & Output and create complex queries.
To create, save, and execute a complex query:
- From the Management Console, select View > Modules > Log Explorer.
The Log Explorer window opens. - Click Template.
The Select and edit templates dialog opens. - Select the Simple Query tab.
- Click Advanced View.
The dialog changes to show the advanced view structure and the tab name changes to Query & Output. - Add the criteria you want to use to select results, as follows:
- Click the AND’d criteria node from the top-level node Filter on raw data (OR’d criteria).
- Click Insert.
- Select Type from the drop-down list.
- Click the ellipsis to select the column and the criteria you want from the drop-down list in the Criteria dialog.
- Click OK when you finish selecting your criteria.
The Criteria dialog closes. - Repeat the preceding steps for derived data, by selecting criteria from the top-level node Filter on derived data (OR’d criteria).
- Select computed information you want to display, as necessary.
Tip: For example, you may want to display a count, an average value, or a maximum value for a column when you group results. The computed information columns are named C1, C2, and so forth.
To add a computed column:
- Click the top-level node User defined aggregate functions.
- Click Insert.
- Select the column and the calculated function, using the drop-down list.
- Define how you want your results grouped, as necessary. To group results:
- Click the top-level node Grouped data.
- Click Insert.
- Select the column you want to group results, using the drop-down list.
Tip: You can group results by values from several columns.
- Specify that the values in your computed columns match particular criteria, as necessary.
- Click on the AND’d criteria node of the top-level node Filter on grouped data (OR’d criteria).
- Click Insert.
- Select the computed column and criteria you want to use.
- Enter a corresponding value.
- Choose the columns of information you want to display and the order. To select each column you want to display:
- Click on the top-level node Displayed columns.
- Click Insert.
- Select the column from the drop-down list.
Tip: You can reorder the displayed columns by clicking Move up and Move down.
- Specify how you want to sort the results in the report. To add a sorting level:
- Click on the top-level node Sorting.
- Click Insert.
- Select the column you want to sort by and how you want to sort, using the drop-down lists.
Tip: You can sort results using several columns.
- Click Execute query.
The Template settings dialog closes and the complex query is created, saved, and executed.