Create a machine group

更新时间:
复制 MD 格式

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.

ParameterTypeRequiredExampleDescription
--projectStringYesaliyun-test-projectThe name of the project.
--group-nameStringYescontainerThe name of the machine group.
--machine-identify-typeStringYesipThe type of machine identifier. Valid values: ip (IP address) and userdefined (custom identifier).
--machine-listStringYes192.168.5.2The IP address or custom identifier of a machine. Specify this parameter multiple times to add multiple machines.