Run a CLI command to create a machine group. A machine group defines a set of servers from which logs are collected.
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 is created. For more information, see Create a project.
Syntax
aliyun sls create-machine-group --project=<value> --group-name=<value> --machine-identify-type=<value> --machine-list=<value> [--machine-list=<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. |
| --group-name | String | Yes | container | The name of the machine group. |
| --machine-identify-type | String | Yes | ip | The type of machine identifier. Valid values: ip (IP address) and userdefined (custom identifier). |
| --machine-list | String | Yes | 192.168.5.2 | The IP address or custom identifier of a machine. Specify this parameter multiple times to add multiple machines. |
该文章对您有帮助吗?