Updating an Agent Configuration
Update an agent configuration.
When you update an agent configuration, you can also update its tags. For more information about tagging, see Resource Tags. To update an agent configuration's tags using the Console, get its details and then select Tags.
Agent configuration updates are detected and automatically loaded.
Use the oci logging agent-configuration update command and required parameters to update an agent configuration:
oci logging agent-configuration update --config-id config_ocid --display-name display_name --is-enabled is-enabled [true|false] --service-configuration service_configuration [OPTIONS]
Example command and JSON filesoci logging agent-configuration update --config-id <config_ocid> \ --display-name <display_name> --is-enabled true \ --service-configuration file://update-service-configuration.json \ --wait-for-state SUCCEEDED --max-wait-seconds 60
update-service-configuration.json
:{ "sourceType": "KUBERNETES", "source": { "name": "KUBERNETES-uniqueid", "scrapeTargets": [ { "resourceType": "PODS", "k8sNamespace": "k8s-ns" } ] }, "destination": { "compartmentId": "<compartment_id>", "metricsNamespace": "metricsnns" }, "filter": { "allowList": [ "regex-test" ], "denyList": [], "filterType": "KUBERNETES_FILTER", "name": "test" } }
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the UpdateUnifiedAgentConfiguration operation to update an agent configuration.
Example API requestPUT /20200531/unifiedAgentConfigurations/<unifiedagentconfiguration_ocid> Host: https://logging.us-phoenix-1.oci.oraclecloud.com <authorization and other headers> { "serviceConfiguration": { "configurationType": "MONITORING", "applicationConfigurations": [ { "sourceType": "KUBERNETES", "source": { "name": "KUBERNETES-uniqueid", "scrapeTargets": [ { "resourceType": "PODS", "k8sNamespace": "k8s-ns" } ] }, "destination": { "compartmentId": "<compartment_id>", "metricsNamespace": "metricsnns" }, "filter": { "allowList": [ "regex-test" ], "denyList": [], "filterType": "KUBERNETES_FILTER", "name": "test" } } ] }, "displayName": "mar-test", "isEnabled": true, "groupAssociation": { "groupList": [ "<dynamic_group_id>" ] }, "definedTags": {}, "freeformTags": {}, "description": "test update" }