Working with Queries
SmartLog lets you quickly and easily create log queries. The query results show in the pane. SmartLog comes with many predefined queries that are ready to run right out of the box. You can create your own custom queries and save them for future use.
Running Queries
You can run a SmartLog an existing query or create a custom query.
To run a query:
- Click and select a predefined or custom query.
Or
- Click in the field and select a recent query.
To create and run a query:
- Click in the field.
- Enter or select query criteria.
The query runs automatically. As you add more criteria, results are updated dynamically.
To manually refresh your query:
|
Click the icon
|
To continuously refresh your query (Auto-Refresh):
|
Click the - icon. The icon is highlighted when you enable Auto-Refresh.
|
The query updates every two seconds while Auto-Refresh is enabled. If the number of logs is greater than 20 in any two-second period, logs are aggregated, and a summary view shows. To see all logs that have been aggregated in a specific time interval, click .
To stop refreshing your query:
|
Click - icon. The icon is not highlighted when you deactivate Auto-Refresh.
|
Configuring Query Defaults
You can use the Query Settings to:
- Define the default query that runs when you open SmartLog
- Set the number of items that show in the pane.
- Sets the time, in seconds, that the show after running a query.
To define the default query:
- Go to > > .
The window opens.
- Enter a query (using the query syntax) in the field.
: Select a query or Define a query in the Query Definition field. Then copy and paste it into the field.
If no default query is specified, SmartLog runs the query.
- Click .
To configure the Top Results:
- Go to > > .
The window opens.
- In the field, enter the number of results to show (default =10).
- In the field, enter the time interval allocated for calculation of top results (default=10 seconds).
Note - SmartLog stops collecting top results after 150000 log entries or after 10 seconds, whichever happens first. To change these limits, refer to sk74800.
- To get top results from Multi-Domain Log Server and multiple Log Servers:
- Select .
- Enter the maximum number of to Log Servers (default=3).
Note - top results are collected from all Log Servers in groups of size configured in .
- Click .
Working with the Favorites List
The list lets you work with predefined and saved custom queries. The predefined queries are organized into folders by Software Blade. You can add new queries to existing folder or create new folders hold them.
You can do these actions with the list:
- Add new custom queries
- Add new query folders
- Delete queries
In this version, you cannot move a query from one folder to a different folder.
Adding a Query to the Favorites List
To add a folder to the Favorites list:
- From the menu, select .
- In the window, enter a name for the new query.
The query criteria show in the Query field.
- Select a folder from the list or click .
- Click .
Creating a New Folder
You can use folders to help you organize custom queries into logical groups. Folders can be created inside of other folders.
You can also do this procedure while adding a new query to the favorites list.
To create a new folder:
- From the menu, select .
- In the window, click the list.
- Select from the list.
- In the window, enter a name for the new folder.
- Select a folder to contain the new folder.
- Click .
Deleting a Folder
You can delete folders that are no longer necessary.
|
Important - When you delete a folder, you also delete any queries included in that folder. We recommend that you carefully look at folder contents before deleting it. In this release, you cannot move a query from one folder to a different one.
|
To delete a folder:
- From the menu, select .
- In the folder, select the folder to be deleted.
- Click .
- Click .
Working with the Results Pane
You can control how the data shows on in the results.
|
Select .This shows log records in a detailed tabular view. You can select the fields that show and can change the column order and width.
|
|
Select . This shows a short summary of basic log data. You cannot customize this view.
|
|
or .
|
|
Show resolved IP addresses and service names.
|
|
Scroll down to increase the quantity of query results that show.
|
|
Export query results to a CSV file.
|
Showing Query Results
Query results can include tens of thousands of log records. To prevent performance degradation, SmartLog only shows the first set of results in the Results pane. Typically, this is 50 results.
Scroll down to show more results. As you scroll down, SmartLog extracts more records from the SmartLog Index Server and adds them to the results set. The number of results shows above the Results pane.
For example, on the first run of a query, you can see the first 50 results (128 ms), out of over 150,000 results. When you scroll down, you can see the first 100 results (128 ms), out of over 150,000 results.
Customizing the Results Pane
By default, SmartLog shows a predefined set of columns and information based on the selected blade in your query. This is known as the . If no blade is specified, a column profile is assigned based on the blade that occurs most frequently in the query results.
The Column Profile defines which columns appear in the and in which order. You can change the Column Profile as necessary for your environment. You can sort the results by the actual event date and time or by the time that the event index arrived to the SmartLog Server.
To use the default Column Profile assignments, right-click a column heading and select > . This option is enabled by default.
To manually assign Column Profile assignments by default, right-click a column heading and select > .
To manually assign a different Column Profile:
- Right-click a column heading and select .
- Select a Column Profile from the options menu.
To change a Column Profile:
- Right-click a column heading and select >
- In the window, select a Column Profile to change.
- Select fields to add from the column and click .
- Select fields to remove from the column and click .
- Select a field in the and then click or to change its position in the Results Pane.
- Double click the Width column to change the default column width for the selected field.
You can drag the right-hand column border in the Results Pane to change the column width. This action is only applicable to the current session. The width defined in the Column Profile will show when you start a new SmartLog session.
To change the sort query order:
- Right-click the column.
- Select or as applicable.
Exporting Query Results
SmartLog lets you export queries to a comma separated value (CSV) file. You can then use Microsoft Excel or other database programs to further analyze the data information print reports.
SmartLog only exports the query result included in the result set. You must scroll down to add more records to the result set. The actual number of results in the result set, shows below the pane.
To export query results:
- Create or run a query in SmartLog.
- Scroll down in the pane until a sufficient quantity of records show.
- From the menu, select > .
- Enter the file name and path and then click .
Creating Custom Queries
Queries can include one or more criteria. You can create custom queries using one or a combination of these basic procedures:
- Right-click columns in the grid view and select .
- Click in the field and then select the fields and filter criteria for those fields.
- Manually enter filter criteria in the field.
A good way to create a new custom query is to run an existing query and then use one of these procedures to change it. You can save the new query in the list.
When you create complex queries, SmartLog suggests, or automatically enters, an appropriate Boolean operator. This can be an implied AND operator, which does not explicitly show.
Selecting Query Fields
You can enter query criteria directly from the Query Definition field.
To select field criteria from the Query Definition field:
- If you are starting a new query, remove query definitions: click
- Put the cursor in the Query Definition Field.
- Select a criterion from the drop-down list or enter the criteria in the Query Definition field.
The query runs automatically.
Selecting Criteria from Grid Columns
You can use the column headings in the view to select query criteria. This option is not available in the view.
To select query criteria from grid columns:
- In the pane, right-click on a column heading.
- Select .
- Select or enter the filter criteria.
The criteria show in the field and the query runs automatically.
You can continue to enter more criteria using this or other procedures.
Manually Entering Query Criteria
You can always type query criteria directly in the field. You can manually create a new query or make changes to an existing query that shows in the field.
As you type, SmartLog helps you by showing recently used query criteria or even complete queries. To use these suggestions, simply select them from the drop down list. If you make a syntax error in a query, SmartLog shows a helpful error message that identifies the error and suggests a solution.
|