Custom Logs and Notifications

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Notification : https://docs.oracle.com/en-us/iaas/Content/Notification/home.htm

Fluentd : https://docs.fluentd.org/parser/syslog

  • Oracle Functions /or Function : With Oracle Functions, you can write code in Java, Python, Node, Go, and Ruby (and for advanced use cases, bring your own Dockerfile, and Graal VM). You can then deploy your code, call it directly or trigger it in response to events, and get billed only for the resources consumed during the execution.
  • The Notifications service enables you to set up communication channels for publishing messages using topics  and subscriptions . When a message is published to a topic, the Notifications service sends the message to all of the topic's subscriptions.

About

This is the official fluentD output plugin for the Oracle Cloud Infrastructure (OCI) Logging service.

https://github.com/oracle/fluent-plugin-oci-logging
topic
A communication channel for sending messages to the subscriptions in the topic. Each topic name is unique across the tenancy.

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Logging 

https://docs.oracle.com/en-us/iaas/Content/Logging/home.htm

Custom Logging

https://docs.oracle.com/en-us/iaas/Content/Logging/Concepts/custom_logs.htm#custom_logs

Use Notifications to get messages whenever alarms, service connectors, and event rules are triggeredYou can also directly publish messages.

Custom logs can be ingested in the following ways:

By configuring the Unified Monitoring Agent. See Installing the Agent for instructions

Custom logs can be viewed in the Oracle Cloud Infrastructure Compute instance page, and have an associated Logs resource. They can also be viewed on the Logging Search page, Logs page, or within an associated Log Groups detail page. Custom logs are also supported in bare metal instances.

The agent can be installed on many machines, and it pulls logs from local directories, where your apps or systems emit logs. The agent can also parse your logs for you. All of this is configured in Agent Configurations. You can create an agent configuration separately, and then associate a custom log with it, or create a custom log and then later create its agent configuration.

An agent configuration is the central mechanism for defining:

  • What hosts you want logs from.
  • What specific logs you want from the hosts.
  • Additional parsers.
  • The custom log destination.

Creating a custom log is a two-step process

  • you create the custom log object first
  • second, create its associated agent configuration
For the agent to run correctly, ensure that your firewall settings allow the following URI endpoints:

  • https://auth.<your region>.oraclecloud.com
  • https://ingestion.logging.<your region>.oci.oraclecloud.com.

Creating Custom Logs


Create Dynamic Group

  1. Open the navigation menu and click Identity & Security. Under Identity, click Dynamic Groups.
  2. Click Create Dynamic Group.
  3. Enter the following:
    • Name: A unique name for the group. The name must be unique across all groups in your tenancy (dynamic groups and user groups). You can't change this later. Avoid entering confidential information.
    • Description: A friendly description.
  4. Enter the Matching Rules. Resources that meet the rule criteria are members of the group.
    • Rule 1: Enter a rule following the guidelines in Writing Matching Rules to Define Dynamic Groups. You can manually enter the rule in the text box or launch the rule builder.
    • Enter additional rules as needed. To add a rule, click +Additional Rule.

  5. If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you are not sure whether to apply tags, skip this option (you can apply tags later) or ask your administrator.
  6. Click Create Dynamic Group.

    The matching rule syntax is verified, but the OCIDs are not. Be sure that the OCIDs you enter are correct.




You can type the rule directly in the text box, or you can use the rule builder.

Using the Rule Builder

The rule builder is a tool available from the Console to help you write matching rules. The rule builder provides menus and text boxes for you to make entries and then writes the rule for you. The rule builder does have some limitations, so you can't use it for all cases.


Launching the Rule Builder

When you click Create Dynamic Group, the Rule Builder is displayed in the Create Dynamic Group dialog.

To create a matching rule using the rule builder

  1. Under the Matching Rules section, click Rule Builder.
  2. From the Include Instances That Match menu, select All of the following or Any of the following.

    All of the following includes only instances that match all of the statements in the rule.

    Any of the following includes instances that match any of the statements in the rule.

  3. Select a resource type from the Match Instances With menu, and then enter the OCID for the resource in the Value field:

    Compartment OCID includes instances in the compartment you specify.

    Instance OCID includes the instances with the OCIDs you specify.

  4. Click +Additional line to add more statements to this rule.

    When you add multiple statements to a rule, remember that Any of the following includes instances that match any of the statements. If you choose All of the following, instances must match all of the specifications in the statements to be included in the group.


----------------------------------------------------------------------------------------------------------------------

Managing Topics and Subscriptions



Create a Topic

  1. Open the navigation menu and click Developer Services. Under Application Integration, click Notifications.
  2. Choose a compartment you have permission to work in (on the left side of the page). The page updates to display only the resources in that compartment. If you're not sure which compartment to use, contact an administrator.

  3. Click Topics.
  4. Click Create Topic at the top of the topic list.
  5. In the Create Topic panel, configure your topic.

    • Name: Required. Specify a friendly name for the topic. It must be unique across the tenancy; validation is case-sensitive. Avoid entering confidential information.
    • Description: Optional. Enter a description for the topic. Avoid entering confidential information.
Create a Subscription

  1. Open the navigation menu and click Developer Services. Under Application Integration, click Notifications.
  2. Choose a compartment you have permission to work in (on the left side of the page). The page updates to display only the resources in that compartment. If you're not sure which compartment to use, contact an administrator.

  3. Click Topics.
  4. Click the name of the topic that you want to add the subscription to.
  5. On the topic detail page, click Create Subscription.
  6. In the Create Subscription panel, configure your subscription for the protocol you want: 

Email subscription
  • Protocol: Select Email.
  • Email: Type an email address.

Flow of Message Publication

Notifications publishes messages when event rules are triggered, alarms are breached, service connectors run, or someone directly publishes a message.


Notifications sends event messages when rules are triggered. The event message is sent to the topic  specified in the rule. For example, a message might be configured for new databases. See Managing Rules for Events.



Comments

Popular posts from this blog

Create OCI Infrastructure : Using Ansible

Oracle -OCI : Foundations

OCI -- Compute Instance Creation : VCN :Subnet