Search Logs Using Keywords and Phrases

You use commands to retrieve log data as well as to perform manipulation on that data. The first (and implicit) command in a query is the search command. A search is a series of commands delimited by a pipe (|) character. The first white-spaced string following the pipe character identifies the command to be used. The pipe character indicates that the results from the prior command should be used as input for the next command.

For example, to search for all database error messages, enter the following logical expression in the Search field of Oracle Log Analytics:

* | SEARCH Severity = 'error' AND 'Entity Type' = 'Database Instance' 

In the previous example:



The following example returns the same result as the previous example:

Severity='error' AND 'Entity Type'='Database Instance'

The SEARCH keyword is optional, and you can directly enter your search criteria in the Search bar to achieve the desired results.

By enclosing the words in quotation marks and including them in the query string as a phrase (‘Database Instance’, for example), only those logs containing the phrase ‘Database Instance’ are returned. In addition, keyword searches where the substring could be interpreted as a separate directive should be specific within quotation marks. For example, to search for the string and, you have to enter the string within single quotation marks (‘and’) to prevent the system from using its Boolean meaning.

List the Recent Searches

Oracle Log Analytics lets you select and run a recently used search. When you click the Search field or enter text in the Search field, Oracle Log Analytics displays a list of recently used searches. This lets you quickly access recently used search commands. You can select any of the listed commands and click Run to execute the selected search command.

Note:

The recently used list is available on a per session basis. So if you sign out of Oracle Log Analytics, and then sign in again, the list from the previous session isn’t displayed. A new list of recent searches is created for your session.

See About Oracle Log Analytics Search in Using Oracle Log Analytics Search.

Use the Autosuggest Feature

When you enter a query in the Search field, the autosuggest feature of Oracle Log Analytics automatically suggests terms that you can use in your query. Oracle Log Analytics displays a list of suggestions, based on the text that you’ve entered in the Search field. For example, if you’ve entered the name of a field or a search action, the autosuggest feature displays the possible values only for that field or the list of available actions.