Searching Logs To perform a search on logs, use this procedure to specify the fields, time range, and text strings for logs that you want to search.
Enabling Logs and Creating Log Groups with
Operator Access Control 🔗
To track Oracle operator activities on your system., learn how to enable
logs, and how to create log groups to manage logs.
To audit the actions that an Oracle operator performs on your system, you can
create an audit log for a compartment and a particular service where you want to monitor
Oracle operator actions.
On the left navigation menu, select Logging,
and then select Logs.
Click Enable Service Log. The Enable Resource Log window opens.
In the Select Resource section, provide
information for each of the fields:
Resource Compartment: Select the
compartment where you want to create the log.
Service: Select Operator
Access Control Service for which you want to enable
log.
Resource: Select an Operator Control
for which you want to enable log.
In the Configure Log section, provide
information for the following fields:
Log Category: Select
Access Logs.
Log Name: Provide a name for the log
that you want to create.
(Optional) Click Show Advanced Options.
(Optional) In the Log Location section, provide
information for the following fields:
Compartment: Select a compartment, if you want
log files to be placed in a different compartment from the one for which
you are creating an audit log.
Log Group: Select a log group to
which you wan to add the log. A log group is a logical container for
logs. Use log groups to streamline log management, including applying
policy or analyzing groups of logs. If you want to create a new log
group, the click Create New Group, and provide
information for the following fields:
Compartment Select the
compartment where you want to place the log group.
Name: Provide a name for the
log group.
Description: Provide a
description for the purpose of the log group.
In the Tag Namespace field, consider
adding a tag namespace (an identifying text
string applied to a set of compartments), or tagging the control with an
existing tag namespace.
In the Log Retention section, select a log retention
period.
When you have completed and reviewed your selections, click
Enable Log. The log pertaining to the operator
control is enabled.
To perform a search on logs, use this procedure to specify the fields, time
range, and text strings for logs that you want to search.
The log is enabled based on specific Operator Controls. Hence these form the top
level filter for the log searches. Additionally, you can also search logs for the
Access Request IDs, Exadata systems where the operator action occurred, or the time
when the action occurred.
The following examples help you understand how to search for specific field.
On the left navigation menu, select Logging,
and then select Logs.
Choose the compartment where the logs are stored.
This will provide a list of
logs which were enabled.
Click the log that you are interested in. log detail page is displayed.
These
logs are always related to a single operator control.
Click the Explore with Log Search link to search for
specific logs.
Case 1: Searching for actions performed using the approval for
a specific access request, ocid.opctlaccessrequest.x during a period
T-start to T-end pertaining to an Operator Control, ocid.opctl.x.
Choose Custom from the
Filter By Time field.
Select Start Date and End
Date.
Click Search.
After
choosing you would be able to see a set of logs.
Now, for example, add the following search criteria ino the
Filter By Field or Text Search
field.
data.accessRequestId='ocid.opctlaccessrequest.x'
This will list the logs matching the search
criteria.
Case 2: Searching for actions on an Exadata systems,
ocid.exadata.x during a period T-start to T-end pertaining to an
Operator Control, ocid.opctl.x.
Choose Custom from the
Filter By Time field.
Click Search.
After
choosing you would be able to see a set of logs.
Now, for example, add the following search criteria ino the
Filter By Field or Text Search
field.
data.systemOcid ='ocid.exadata.x'
This will list the logs matching the search
criteria.
You can also search the logs by the content. Use the
log-content field. For more information, see Searching Logs.
To search for specific linux commands executed, use the Advanced
Mode.
Create a basic search using the examples given above (case
1 or case 2), and then switch to Advanced Mode.
For
example, to search for all the logs with the action
vi add the following
criteria:
and text_contains(data.message, 'proctitle=vi ', true)
When performing a search on the Logging Search page, you
can click Show Advanced Mode to enter your own custom log
search queries.
For
example:
search "ocid1.compartment.oc1..x/ocid1.loggroup.oc1.iad.loggroup_x/ocid1.log.oc1.iad.log_x"
| data.systemOcid='ocid1.exadata.x' and text_contains(data.message, 'proctitle=vi ', true)
| sort by datetime desc