Request syntax

Updated at:

The Simple Log Service command-line interface (CLI) provides three syntax formats that you can use to run subcommands, configure the CLI, and obtain help. This topic describes these syntax formats.

CLI subcommands

You can use Simple Log Service CLI subcommands for basic operations, such as creating projects and Logstores.

  • Syntax

    aliyunlog log <subcommand> [parameters | global options]
    • subcommand: A supported subcommand. For more information, see Subcommand list.

    • parameters: The supported parameters. For a list of parameters for each subcommand, see the documentation for that subcommand.

    • global parameters: The supported global parameters. For more information, see Global parameters.

  • Example

    The following example shows how to create a project:

    aliyunlog log create_project --project_name="project-a" --project_des="project created from cli"

The configure command

You can use this command to configure basic information, such as AccessKey pairs, endpoints, and accounts.

  • Syntax

    aliyunlog configure <access_id> <access-key> <endpoint> [<client-name>]

    Replace <access_id>, <access-key>, and <endpoint> with the AccessKey ID, AccessKey secret, and endpoint that have permissions to manage Simple Log Service. <client-name> is the name of the account that runs the command. For more information, see AccessKey pair and Endpoints.

  • Example

    The following example shows how to create a test account:

    aliyunlog configure yourAccessKeyID yourAccessKeySecret cn-hangzhou.log.aliyuncs.com test

Get help and version information

You can obtain online help and version information.

  • Syntax

    aliyunlog [--help | --version]
  • Example

    The following example shows how to obtain the CLI version information:

    aliyunlog --version