全部產品
Search
文件中心

Simple Log Service:get_logtail_config

更新時間:Jun 30, 2024

調用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_name

String

aliyun-test-project

Project名稱。

--config_name

String

config_name2

Logtail配置名稱。

關於該命令的全域參數,請參見全域參數

樣本

  • 請求樣本

    使用預設帳號擷取名稱為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": 1719370155,
      "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",
        "timeKey": "time",
        "topicFormat": "none"
      },
      "inputType": "file",
      "lastModifyTime": 1719370155,
      "logSample": "xxx 2017-11-11 11:11:11 hello alicloud.",
      "outputDetail": {
        "endpoint": "cn-hangzhou-intranet.log.aliyuncs.com",
        "logstoreName": "logstore-a",
        "region": "cn-hangzhou",
        "telemetryType": "logs"
      },
      "outputType": "LogService"
    }

錯誤碼

如果返回報錯資訊,請參見具體介面的錯誤碼處理。更多資訊,請參見GetConfig錯誤碼處理

API參考

GetConfig