全部產品
Search
文件中心

Simple Log Service:Logtail與LoongCollector相容性說明

更新時間:Jan 16, 2026

本文主要介紹日誌採集工具 Logtail與LoongCollector版本演化與核心功能變更,以及Logtail向LoongCollector升級以及LoongCollector復原至Logtail版本的操作流程。

版本對比

版本命名變更說明

Logtail、iLogtail、LoongCollector實際上是同一軟體在不同時期的不同命名:

  • Logtail/iLogtail:3.0版本之前的命名。

  • LoongCollector:3.0版本之後的命名。

日誌與Tag解析正常化

  1. 日誌主體重複key處理

    • 1.8版本之後:不允許日誌主體中出現重複的key,例如輸入content: xxx, content: yyy將只保留一個content: xxx

    • 1.8版本之前:保留所有重複key並重新命名,例如輸出content: xxx, content_0: yyy

  2. 日誌tag重複key處理

    • 1.8版本之後:不允許日誌tag中出現重複的key,例如輸入__tag__:tag: xxx, __tag__:tag: yyy將只保留一個__tag__:tag: xxx

    • 1.8版本之前:保留所有重複key並重新命名,例如輸出__tag__:tag: xxx, __tag__:tag_0: yyy

單行、多行Tlog增強

  1. 異常處理機制變更

    • 2.x版本:預設按\n切分,如需丟棄可通過Multiline.UnmatchedContentTreatment參數設定為discard

    • 1.x版本:無法按行首分割時將整個內容作為一塊處理。

  2. 最後一行Tlog

    • 1.8版本之前:無斷行符號符的最後一行日誌或最後一段多行日誌需要等待斷行符號或下一個多行段落才會輸出。

    • 1.8版本之後:引入逾時機制控制。為了保證最後一段完整性,預設延時為60秒,2.0版本之前無法調整。2.0開始全域控制參數為default_reader_flush_timeout,採集配置級控制參數為FlushTimeoutSecs。如果對延時敏感可通過上述參數調整,不建議設定為0,以免日誌截斷。

Tag處理機制變更

通過擴充外掛程式處理後的Tag將保留在Tag形式中,即寫入資料模型tags結構中,相比之前寫入content結構的方式大幅節省空間的:

  • 對消費情境有影響,需要進行相容性處理。

  • 對查詢情境無影響。

容器日誌採集路徑變更

採集ACK叢集容器日誌時,如果配置使用ACK控制台建立:

  • 2.0版本起:目錄的最大遞迴深度預設是0,如果採集路徑中有/**/,則為10。

  • 2.0版本之前:最大遞迴深度預設均為100。

主機情境Logtail升級到LoongCollector

從Logtail升級到LoongCollector

請根據主機作業系統,參照下表對應命令升級Logtail至LoongCollector。

主控件類型

作業系統

下載方式

安裝方式

Linux

ARM

主機可連網,直接下載。

wget https://aliyun-observability-release-${region_id}.oss-${region_id}.aliyuncs.com/loongcollector/linux64/latest/loongcollector.sh -O loongcollector.sh;

根據網路情況選擇安裝命令。

#公網方式安裝
chmod +x loongcollector.sh; ./loongcollector.sh upgrade

x86-64

ARM

主機離線,需先在可以訪問公網的伺服器上下載安裝指令碼與安裝包。

wget https://aliyun-observability-release-${region_id}.oss-${region_id}.aliyuncs.com/loongcollector/linux64/latest/loongcollector.sh;wget http://aliyun-observability-release-${region_id}.oss-${region_id}.aliyuncs.com/loongcollector/linux64/latest/aarch64/main/loongcollector-linux64.tar.gz;

請將安裝指令碼和安裝包拷貝至需要安裝LoongCollector的伺服器上後,根據網路情況選擇安裝命令。

#公網方式安裝
chmod +x loongcollector.sh; ./loongcollector.sh upgrade-local 

x86-64

主機離線,需先在可以訪問公網的伺服器上下載安裝指令碼與安裝包。

wget https://aliyun-observability-release-${region_id}.oss-${region_id}.aliyuncs.com/loongcollector/linux64/latest/loongcollector.sh;wget http://aliyun-observability-release-${region_id}.oss-${region_id}.aliyuncs.com/loongcollector/linux64/latest/x86_64/main/loongcollector-linux64.tar.gz;

如果顯示以下資訊,則表示升級成功。

Try to stop ilogtail ...
kill process Name: ilogtail pid: 878
kill process Name: ilogtail pid: 879
stop successfully
Stop ilogtail successfully.
Upgrading loongcollector files ...
Upgrade loongcollector files successfully.
Starting loongcollector ...
loongcollector is running
Upgrade loongcollector successfully.

從LoongCollector復原到Logtail

請根據主機作業系統,參照下表對應命令將LoongCollector復原到Logtail。

說明

必須要重新下載logtail.sh指令碼,不能使用原來的logtail.sh指令碼。

作業系統

下載方式

升級方式

ARM與x86-64

主機可連網:

wget https://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh -O logtail.sh; 

下載完成後執行升級命令。

chmod +x logtail.sh; sudo ./logtail.sh upgrade;

如果需要指定某個特定版本,則執行如下命令。

# 比如指定 1.8.7 版本,根據實際情況替換版本號碼。
chmod +x logtail.sh; sudo ./logtail.sh upgrade -v -v 1.8.7;

ARM

主機離線,需先在可以訪問公網的伺服器上下載安裝指令碼與安裝包:

wget https://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh; wget http://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/aarch64/logtail-linux64.tar.gz;

請將安裝指令碼和安裝包拷貝至需要升級Logtail的伺服器上後,執行如下升級命令。

chmod +x logtail.sh; ./logtail.sh upgrade-local;

x86-64

主機離線,需先在可以訪問公網的伺服器上下載安裝指令碼與安裝包:

wget https://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail.sh; wget http://logtail-release-${region_id}.oss-${region_id}.aliyuncs.com/linux64/logtail-linux64.tar.gz;