Getting started with IBM® Cloud Logs Routing V3
Use the IBM Cloud Logs Routing service to route platform logs from your IBM Cloud account to your chosen target destination.
Complete the following steps to start using IBM® Cloud Logs Routing:
Before you begin
-
If you don't have an IBM Cloud account, register an IBM Cloud account. You need an IBMid to work in IBM Cloud.
-
Check the regions where the IBM Cloud Logs Routing service is available.
-
Check that the user who is configuring IBM Cloud Logs Routing for the IBM Cloud® account has sufficient permissions to manage the IBM Cloud Logs Routing service. For more information, see Managing IAM access for IBM Cloud Logs Routing.
You need platform role Adminsitrator to manage resources.
-
Install the following tools:
-
Download and install jq to process output and query desired results.
-
Provision or have acces to an IBM Cloud Logs instance. For more information, see Provisioning an instance.
Creating a service to service authorization
You must use IBM Cloud® Identity and Access Management (IAM) to create an authorization that grants IBM Cloud Logs Routing access to IBM Cloud Logs so the IBM Cloud Logs Routing service can send logs to your IBM Cloud Logs instance destination (target).
You must have the sender role for IBM Cloud Logs before you configure the service to service authorization.
Complete the following steps:
-
In the IBM Cloud console, click Manage > Access (IAM), and select Authorizations.
-
Click Create.
-
Configure the source account. Select This account.
-
Select Logs Routing as the source service. Then, set the scope of the access to All resources.
-
Select Cloud Logs as the target service. Then, set the scope of the access to All resources, which grants access to all IBM Cloud Logs instances, or a single instance by configuring Resources based on selected attributes > Service Instance.
Other attributes are not supported for this type of authorization.
-
In the Service Access section, select Sender to assign access to the source service that accesses the target service.
-
Click Authorize.
For more information, see Creating a S2S authorization to grant access to send logs to IBM Cloud Logs.
Configure the primary metadata location and API version
Complete the following steps:
-
Click the Menu icon
> Observability.
-
Click Logging >Routing.
-
Click the Settings tab.
-
Click Edit next to the setting to be changed.
Enter a Primary Metadata location.
Set the API version to
3.
Create a target
Complete the following steps to create a target:
-
Click the Menu icon
> Observability.
-
Select Logging > Routing.
-
In the Targets section, click Create to open the create panel.
-
In the Choose destination, pick Search by instance or Specify CRN.
Select Search by instance to choose an IBM Cloud Logs instance from the table that is available in the account
Select Specify CRN to add the IBM Cloud Logs instance CRN of an instance that is located in a different account.
-
In the target details section, complete the following tasks:
Enter the target name.
Enable the toggle from Not set to automatically set your new target as a default target in your IBM Cloud Logs Routing settings.
-
Click Create target.
Configure a route
Complete the following steps to create a target:
-
Click the Menu icon
> Observability.
-
Click Logging > Routing.
-
In the Routes tab, click Create.
-
In Routing rules section, modify the Action for Rule 1:
Select an Action for Rule 1:
-
Select Send logs from for the rule to route platform logs to the associated targets.
-
Select Drop logs from for the rule to drop platform logs matching this rule.
Add the inclusion filters to determine the platform logs routed to the targets specified in the rule.
-
Select a condition, and specify the location values to be matched by the inclusion filter.
-
To add multiple inclusion filters, click Add filter to add additional filters.
Add the targets to associate with the rule by selecting a target from the list. If you do not have a target defined, click Add target to create a new one.
-
-
Click Add rule to add additional rules to the route.
The order of route rules affects the routing behavior. Rules are processed in order and once a rule is matched, the subsequent rules are not processed.
The order of the routing rules can be changed by clicking the up and down arrows to the right of each rule definition.
If you need to remove a rule or filter, click the Remove icon associated with the rule or filter.
You can configure up to 10 rules per route.
-
Click Next.
-
Enter a name for the route.
-
Review the route definition ensuring the order of the rules is as intended.
For more information, see Understanding routing precedence.
-
Click Create.
Verifying that logs are sent to the destination target
Verify that the logs are routed to your IBM Cloud Logs instance.
Complete the following steps:
-
Launch the IBM Cloud Logs web UI for the IBM Cloud Logs instance that is configured as the target to collect platform logs in a region. This is the instance that you selected in the step where you setup a target.
-
View logs through custom views. For more information, see Viewing logs.
All platform logs are generated in JSON. You can filter platform logs in your instance be selecting the value of ibm-platform-logs as the
applicationNameor by running the Lucene query:coralogix.metadata.applicationName:"ibm-platform-logs"