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:

  1. From the Management Console, select View > Modules > Log Explorer.
    The Log Explorer window opens.
  2. Click Template.
    The Select and edit templates dialog opens.
  3. Select the Simple Query tab.
  4. Click Advanced View.
    The dialog changes to show the advanced view structure and the tab name changes to Query & Output.
  5. Add the criteria you want to use to select results, as follows:
    1. Click the AND’d criteria node from the top-level node Filter on raw data (OR’d criteria).
    2. Click Insert.
    3. Select Type from the drop-down list.
    4. Click the ellipsis to select the column and the criteria you want from the drop-down list in the Criteria dialog.
    5. Click OK when you finish selecting your criteria.
      The Criteria dialog closes.
    6. Repeat the preceding steps for derived data, by selecting criteria from the top-level node Filter on derived data (OR’d criteria).
  6. 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:

    1. Click the top-level node User defined aggregate functions.
    2. Click Insert.
    3. Select the column and the calculated function, using the drop-down list.
  7. Define how you want your results grouped, as necessary. To group results:
    1. Click the top-level node Grouped data.
    2. Click Insert.
    3. Select the column you want to group results, using the drop-down list.

    Tip: You can group results by values from several columns.

  8. Specify that the values in your computed columns match particular criteria, as necessary.
    1. Click on the AND’d criteria node of the top-level node Filter on grouped data (OR’d criteria).
    2. Click Insert.
    3. Select the computed column and criteria you want to use.
    4. Enter a corresponding value.
  9. Choose the columns of information you want to display and the order. To select each column you want to display:
    1. Click on the top-level node Displayed columns.
    2. Click Insert.
    3. Select the column from the drop-down list.

    Tip: You can reorder the displayed columns by clicking Move up and Move down.

  10. Specify how you want to sort the results in the report. To add a sorting level:
    1. Click on the top-level node Sorting.
    2. Click Insert.
    3. 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.

  11. Click Execute query.
    The Template settings dialog closes and the complex query is created, saved, and executed.

Related Information:

Related Tasks: