Run a CLI command to apply a Logtail configuration to a machine group. After the configuration is applied, the servers in the machine group start to collect logs.
Prerequisites
Before you run this command, make sure that the following prerequisites are met:
Simple Log Service (SLS) is activated. For more information, see Getting started with SLS.
The SLS CLI is installed and configured. For more information, see Install the CLI and Configure the CLI.
An SLS project, a Logstore, a Logtail configuration, and a machine group are created. For more information, see Create a project, Create a Logstore, Create a Logtail pipeline configuration, and Create a machine group.
Syntax
aliyun sls apply-config-to-machine-group --project=<value> --config-name=<value> --machine-group=<value>Parameters
The following table describes the required and command-specific parameters.
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| --project | String | Yes | aliyun-test-project | The name of the project. |
| --config-name | String | Yes | json-log-config | The name of the Logtail configuration. |
| --machine-group | String | Yes | container | The name of the machine group. |
For information about global parameters, see Global parameters.