Mengambil konfigurasi Logtail tertentu.
Sintaks permintaan
aliyunlog log get_logtail_config --project_name=<nilai> --config_name=<nilai> [--access-id=<nilai>] [--access-key=<nilai>] [--sts-token=<nilai>] [--region-endpoint=<nilai>] [--client-name=<nilai>] [--jmes-filter=<nilai>] [--format-output=<nilai>] [--decode-output=<nilai>]Parameter permintaan
Tabel berikut menjelaskan parameter yang diperlukan dan spesifik untuk perintah get_logtail_config.
Parameter | Tipe | Diperlukan | Contoh | Deskripsi |
--project_name | String | Ya | aliyun-test-project | Nama proyek. |
--config_name | String | Ya | config_name2 | Nama konfigurasi Logtail. |
Untuk informasi lebih lanjut tentang parameter global antarmuka baris perintah (CLI) Layanan Log, lihat Parameter Global.
Contoh
Contoh Permintaan
Gunakan akun default untuk mengambil konfigurasi Logtail bernama config_name2.
aliyunlog log get_logtail_config --project_name="aliyun-test-project" --config_name="config_name2"Untuk menyimpan konfigurasi Logtail yang dihasilkan ke dalam file tertentu, jalankan perintah berikut:
aliyunlog log get_logtail_config --project_name="aliyun-test-project" --config_name="config_name2" >>export_logtail_config.jsonContoh Respon
{ "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" }
Kode kesalahan
Jika pesan kesalahan diterima, perbaiki kesalahan sesuai dengan kode kesalahan operasi API terkait. Untuk informasi lebih lanjut, lihat Kode Kesalahan.