Enforcing default targets
You can configure up to two default targets for collecting logs data that is not explicitly managed in the IBM Cloud Logs Routing account's routing rules.
Managing default targets using the UI
You can manage your default targets using the IBM Cloud Logs Routing UI. For more information, see Creating a target using the UI and Updating a target using the UI.
Prereqs
-
Ensure you have the correct IAM permissions to configure IBM Cloud Logs Routing settings.
-
Log in to IBM Cloud by running the following command: ibmcloud login
Identify targets
Get the list of targets that are defined in the account. Run the following command:
ibmcloud logs-router target list
Copy the ID value of the targets that you want to configure in the account.
Check your current account settings
To check your account's configuration and find out whether there are default targets that are configured, run the following command:
ibmcloud logs-router setting get
The Default targets setting lists any targets in the account that are configured as default targets.
Configure default targets
Get the list of IDs for the targets that you want to configure as default targets. Then, run the following command to configure the default targets in the account:
When you run the command, make sure that you include the target IDs of all the default targets in the account. The command replaces the exiting configuration with the new one.
ibmcloud logs-router setting update --default-targets '[{TARGETS}]'
Where TARGETS represent the list of comma-separated target IDs.
For example,
ibmcloud logs-router setting update --default-targets '[{"id": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4"}]'