This sample implements a simple architecture for exporting OCI Logs to Sumologic.
Here are the steps to set up OCI.
Name: ABC
Create a compartment to contain the following:
- Virtual Cloud Network
- Application + Function
- Service Connector
Name: functions-developers
Create a user group where we can assign developer related policies.
See common policies.
Developer can create, deploy and manage Functions and Applications
See reference
Allow group functions-developers to manage repos in tenancy
Allow group functions-developers to manage serviceconnectors in tenancy
Allow group functions-developers to manage logging-family in tenancy
Allow group functions-developers to manage functions-family in tenancy
Allow group functions-developers to use cloud-shell in tenancy
Allow group functions-developers to use virtual-network-family in tenancy
Allow service faas to read repos in tenancy where request.operation='ListContainerImageSignatures'
Service Connector can access Application + Function, Audit Logs
Allow any-user to manage functions-family in compartment ABC where all {request.principal.type='serviceconnector'}
Allow any-user to manage logging-family in compartment ABC where all {request.principal.type='serviceconnector'}
Quick Start guide on OCI Functions before proceeding.
We will need to build and deploy a function. The above guide takes you step by step.
These are the variables we need to set up in the Function Application.
Here are the supported variables:
Environment Variable | Default | Purpose |
---|---|---|
SUMOLOGIC_ENDPOINT | not-configured | Sumologic API endpoint |
MAX_RECORDS_PER_POST | 1000 | Maximum records to send for each POST. i.e, a batch size. |
LOGGING_LEVEL | INFO | Controls function logging outputs. Choices: INFO, WARN, CRITICAL, ERROR, DEBUG |
SEND_AS_JSON_ARRAY
If the Function times out, please change the function timeout setting.
Please see these references for more details.
Copyright (c) 2014, 2023 Oracle and/or its affiliates The Universal Permissive License (UPL), Version 1.0