Study guide
16.2 Logging Search, the Logging Query Language & OCI Audit
OCI 2026 Architect Professional 1Z0-997-26
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Overview & Architecture Foundations
1.1 Exam Logistics, the 2026 Blueprint & How to Use This Guide 1.2 The OCI Well-Architected Framework & Architectural Tradeoffs
2 Chapter 2: High Availability & Resilient Design
2.1 Availability Domains, Fault Domains, Instance Pools & Load Balancers 2.2 OCI DNS Traffic Steering, Geolocation & Health Checks 2.3 Block Volume Replication, Volume Groups & Backup Policies 2.4 Object Storage Replication, Versioning & Retention Rules (WORM)
3 Chapter 3: Full Stack Disaster Recovery
3.1 Full Stack Disaster Recovery: Protection Groups, Members & Permissions 3.2 DR Plans: Switchover, Failover, Prechecks & Plan Execution 3.3 DR Drills, Plan Customization & Operational Readiness
4 Chapter 4: Container Instances, OCIR & OCI DevOps
4.1 Containerization, Microservices & OCI Container Instances 4.2 OCI Container Registry: Repositories, Push & Pull, and Image Management 4.3 OCI DevOps: Code Repositories, Build Pipelines & Deployment Strategies
5 Chapter 5: OCI Kubernetes Engine (OKE)
5.1 OKE Cluster Types, Node Options & Cluster Creation 5.2 OKE Networking: VCN-Native Pod Networking vs. Flannel, Subnet Sizing & Load Balancers 5.3 OKE Workload Identity, Secrets & Persistent Storage
6 Chapter 6: Serverless Functions & API Gateway
6.1 OCI Functions: Concepts, Invocation Modes, Integrations & Image Security 6.2 API Gateway: Authentication, JWT Validation, Rate Limiting & Usage Plans
7 Chapter 7: Messaging & Event-Driven Design
7.1 OCI Streaming, OCI Queue & Messaging Patterns for Microservices 7.2 OCI Events, Event Rules & OCI Notifications Fan-Out
8 Chapter 8: Infrastructure as Code with Terraform & Resource Manager
8.1 Infrastructure as Code with Terraform and the OCI Provider 8.2 OCI Resource Manager: Stacks, Jobs, Drift Detection & Private Endpoints
9 Chapter 9: Identity & Multi-Tenancy Governance
9.1 IAM Policy Design: Verbs, Conditions, Dynamic Groups & Principals 9.2 Organizations Management, Governance Rules & Compartment Quotas
10 Chapter 10: Security Posture with Cloud Guard & Security Zones
10.1 Cloud Guard: Detector Recipes, Problems, Scores & Responders 10.2 Security Zones & Vulnerability Scanning
11 Chapter 11: Secure Access & Network Protection
11.1 Layered Network Security: Security Lists, NSGs & Private Access to Services 11.2 OCI Bastion: Managed SSH, Port Forwarding & SOCKS5 Sessions 11.3 Zero Trust Packet Routing (ZPR): Security Attributes & Intent-Based Policy 11.4 OCI Network Firewall: Policies, Inspection Routing, Tunnel Inspection & Private NAT
12 Chapter 12: Application & Data Protection: WAF, Certificates & Vault
12.1 OCI Web Application Firewall: Policies, Modules, Actions & Enforcement Points 12.2 OCI Certificates: Private CAs, TLS Certificates, Renewal & Integrations 12.3 OCI Vault Key Management: Vault Types, Protection Modes, Dedicated KMS & External KMS 12.4 Vault Secrets: Versions, Rotation States, Automatic Generation & Rotation
13 Chapter 13: Base Database Service & Autonomous AI Database
13.1 Base Database Service: DB Systems, RAC, Data Guard, Cloning & Maintenance 13.2 Autonomous AI Database: Workload Types, Deployment Options, Services & Connectivity 13.3 Operating Autonomous AI Database: Scaling, Cloning, Backups, Patching & Self-Tuning 13.4 Autonomous Data Guard & Backup-Based Disaster Recovery for Autonomous AI Database
14 Chapter 14: Recovery Service, Global Distribution & OCI Cache
14.1 Autonomous Recovery Service: Protection Policies, Real-Time Protection & Retention Lock 14.2 Globally Distributed Autonomous AI Database: Sharding, Data Placement & Replication 14.3 OCI Cache: Valkey and Redis Clusters, Sharding, Security & Cross-Region Replication
15 Chapter 15: Monitoring, Alarms & Notifications
15.1 OCI Monitoring: Metrics, Namespaces, Custom Metrics & Monitoring Query Language 15.2 Alarms & Notifications: Trigger Rules, Absence Alarms, Split Messages, Suppression & Delivery
16 Chapter 16: Logging, Audit, Connector Hub & Search
16.1 OCI Logging: Log Groups, Service Logs, Custom Logs & the Unified Monitoring Agent 16.2 Logging Search, the Logging Query Language & OCI Audit 16.3 Connector Hub: Moving Logs, Metrics, Queue Messages & Streams Between Services 16.4 OCI Search with OpenSearch & Resource Search for Observability
16.2 Logging Search, the Logging Query Language & OCI Audit
Key Takeaways Explain This Topic AI
A Logging query starts with search and one or more log streams scoped to a compartment, log group, or log, such as search "compartmentOcid/logGroup/log" .
In the Logging Query Language, logContent is a special column for full-text search over the whole log entry, and it supports wildcards such as '*ERROR*' .
The summarize operator aggregates log entries by fields and time buckets, for example summarize count() by rounddown(datetime, '5m') .
OCI Audit records calls to public OCI API endpoints made through the Console, CLI, SDKs, custom clients, and other OCI services.
Audit logs are retained for 365 days, a tenancy-level retention period that cannot be changed.
Last updated: October 2026
Logging Search
The Search page in OCI Logging lets you query many logs at once: several logs, several log groups, or a whole compartment, including the _Audit log group. Results can be filtered, aggregated, and visualized. Searches are available in the Console, the Logging Search API , and the CLI.
Basic mode builds filters with form fields and a time range.
Advanced mode lets you write the Logging Query Language directly.
Saved searches store useful queries for reuse by the team.
Field names are case-sensitive and use JSON dot notation, such as data.statusCode . Names with special characters are quoted, such as "opc-request-id" .
The Logging Query Language
A query is a pipeline. It starts with a log stream and passes the entries through operators separated by | .
- Log Streams search "compartmentOcid/logGroupNameOrOcid/logNameOrOcid"
- search "compartmentOcid/logGroupNameOrOcid"
- search "compartmentOcid"
- search "compartmentOcid/appLogs/apiLog", "compartmentOcid_2/lbLogs"
The scope can be one log, one log group, or a whole compartment, and several streams can be combined in one query.
- Filtering With where search "compartmentOcid/appLogs"
- | where data.statusCode = 500 and data.path = '/checkout'
Comparison operators: = , != , > , >= , < , <= ; Boolean operators: and , or , and not(...) .
Functions such as contains_ci(...) (case-insensitive) and contains_cs(...) (case-sensitive) check for substrings.
Full-text search uses the special column logContent , which represents the whole original message. where logContent = 'ERROR' matches a value exactly, and where logContent = '*ERROR*' matches entries that contain ERROR anywhere.
Shaping Results
- Operator Purpose Example
- select Choose and rename fields select data.clientIp as ip, data.statusCode
- extend Add a computed column extend concat(host, '.example.com') as fqn
- sort by Order results, ascending by default sort by datetime desc
- top N by Keep the top N rows top 10 by data.latencyMs
- dedup Remove duplicates by fields dedup data.clientIp
- count Count rows count
- summarize Aggregate by fields and time buckets summarize count() as errors by rounddown(datetime, '5m')
Aggregate functions include count() , sum() , avg() , min() , max() , first() , and last() . The rounddown(datetime, '1m') function buckets timestamps into intervals in days, hours, minutes, or seconds, which is how you build an "errors per 5 minutes" chart.
- Worked Example: Finding a Spike of Errors search "compartmentOcid/prodLogs/apiGatewayAccess"
- | where data.statusCode >= 500
- | summarize count() as errors by data.path, rounddown(datetime, '5m') as bucket
- | sort by errors desc
This shows which API paths produced server errors in each five-minute bucket, sorted by count. The same search and where logic is what a Connector Hub log filter task uses to choose which entries to move (Section 16.3).
OCI Audit
The Audit service automatically records calls to all public OCI API endpoints , whether they come from the Console, CLI, SDKs, your own clients, or other OCI services. All services support Audit logging, and it needs no setup.
What an Audit Event Contains
Audit events use the CloudEvents 0.1 envelope. Important attributes include:
- Attribute Meaning
- eventType and eventTime What happened and when
- data.identity Who made the call, such as principalName , the IP address, and the authentication type
- data.request Request details, such as the action ( GET , POST , DELETE ) and path
- data.response The response, including the HTTP status
- data.resourceId and data.compartmentId The affected resource and its compartment
Since October 8, 2019, Audit uses the version 2 schema , which is what the Console displays.
The Object Storage Limitation
For Object Storage, Audit records bucket-related events, such as creating a bucket or changing its visibility, but not object-related events such as reading or writing objects. Use the Object Storage read and write service logs for object access (Section 16.1).
Viewing and Searching
Audit logs are organized by compartment , so you need to know the compartment where an event happened. You can browse them on the Audit page or search them with other logs through the _Audit log group on the Logging Search page: search "compartmentOcid/_Audit"
- | where data.request.action = 'DELETE'
- | sort by datetime desc
- IAM and Retention
Grant auditors read access with a policy such as allow group Auditors to read audit-events in tenancy , or limit it to one compartment.
Audit logs are retained for 365 days . Retention is a tenancy-level setting that applies to all regions and compartments, and it cannot be changed .
For longer retention or analysis in other tools, use Connector Hub with Logging as the source and Object Storage, Streaming, or Logging Analytics as the target.
Common Investigation Patterns
- Question Where to look
- Who deleted the production load balancer? Audit: DELETE on the load balancer, with data.identity.principalName
- Who downloaded a file from a bucket? Object Storage read service log
- Why are users getting 502 errors? Load Balancer access and error logs, then backend custom logs
- Was traffic to the database subnet rejected? VCN flow logs for rejected records
- Which API paths had the most errors in the last hour? API Gateway access logs with summarize