Apply a Logtail configuration to a machine group

更新时间:
复制 MD 格式

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.

ParameterTypeRequiredExampleDescription
--projectStringYesaliyun-test-projectThe name of the project.
--config-nameStringYesjson-log-configThe name of the Logtail configuration.
--machine-groupStringYescontainerThe name of the machine group.

For information about global parameters, see Global parameters.