文档

get_logtail_config

更新时间:

调用CLI命令获取指定Logtail配置。

请求语法

aliyunlog log get_logtail_config --project_name=<value> --config_name=<value> [--access-id=<value>] [--access-key=<value>] [--sts-token=<value>] [--region-endpoint=<value>] [--client-name=<value>] [--jmes-filter=<value>] [--format-output=<value>] [--decode-output=<value>]

请求参数

该命令的必选和特有参数描述如下。
参数名称数值类型是否必选示例值描述
--project_nameStringaliyun-test-projectProject名称。
--config_nameStringconfig_name2Logtail配置名称。
关于该命令的全局参数,请参见全局参数

示例

  • 请求示例
    使用默认账号获取名称为config_name2的Logtail配置。
    aliyunlog log get_logtail_config --project_name="aliyun-test-project" --config_name="config_name2"
    如果您需要将查询到的Logtail配置保存到指定文件,可参考如下示例:
    aliyunlog log get_logtail_config --project_name="aliyun-test-project" --config_name="config_name2" >>export_logtail_config.json
  • 返回示例
    {
      "configName": "config_name2",
      "createTime": 1622119397,
      "inputDetail": {
        "adjustTimezone": false,
        "delayAlarmBytes": 0,
        "delaySkipBytes": 0,
        "discardNonUtf8": false,
        "discardUnmatch": true,
        "dockerFile": false,
        "enableRawLog": false,
        "enableTag": false,
        "fileEncoding": "utf8",
        "filePattern": "file_pattern",
        "filterKey": [
          "time",
          "value"
        ],
        "filterRegex": [
          "time",
          "value"
        ],
        "key": [
          "time",
          "value"
        ],
        "localStorage": true,
        "logBeginRegex": "xxx.*",
        "logPath": "/log_path",
        "logTimezone": "",
        "logType": "common_reg_log",
        "maxDepth": 1000,
        "maxSendRate": -1,
        "mergeType": "topic",
        "preserve": true,
        "preserveDepth": 0,
        "priority": 0,
        "regex": "xxx ([\\w\\-]+\\s[\\d\\:]+)\\s+(.*)",
        "sendRateExpire": 0,
        "sensitive_keys": [],
        "tailExisted": false,
        "timeFormat": "time_format",
        "topicFormat": "none"
      },
      "inputType": "file",
      "lastModifyTime": 1622119416,
      "logSample": "xxx 2017-11-11 11:11:11 hello alicloud.",
      "outputDetail": {
        "endpoint": "cn-hangzhou-b-intranet.log.aliyuncs.com",
        "logstoreName": "logstore-a",
        "region": "cn-hangzhou-b"
      },
      "outputType": "LogService"
    }

错误码

如果返回报错信息,请参见具体接口的错误码处理。更多信息,请参见GetConfig错误码处理

API参考

GetConfig

  • 本页导读 (1)
文档反馈