By default, each log file matches only one Logtail configuration. To send the same file's logs to multiple Logstores, use one of the following approaches.
Choose an approach
Approach | How it works | Performance impact |
Server-side replication (recommended) | Collect logs once with Logtail, then replicate through data transformation | None on the source server |
Multiple Logtail configurations | Configure Logtail to read the same file more than once | Increases CPU, memory, disk I/O, and network I/O on the server |
Server-side replication (recommended)
Collect logs into one Logstore, then use the Simple Log Service (SLS) data transformation feature to replicate them to other Logstores. Logtail reads the file only once, so there is no additional resource consumption on the source server.
For instructions, see Replicate data from a Logstore.
Multiple Logtail configurations
Matching a file to multiple Logtail configurations increases CPU, memory, disk I/O, and network I/O usage on the server. This can affect the performance of other services on the same host.
Server scenarios
Use one of the following methods:
Method 1: Create a symbolic link
Create a symbolic link for the directory that contains the log file. Use the original path in one Logtail configuration and the symbolic link path in another.
For example, to create a symbolic link named /home/log/nginx/link_log that points to /home/log/nginx/log:
ln -s /home/log/nginx/log /home/log/nginx/link_logThen configure one Logtail configuration to monitor /home/log/nginx/log and the other to monitor /home/log/nginx/link_log.
Method 2: Enable multi-collection in the Logtail configuration
When creating a Logtail configuration, turn on Allow File to Be Collected for Multiple Times in the Input Configurations section.

For setup instructions, see:
Container scenarios
For container log collection, see:
Console
When creating a Logtail configuration, turn on Allow File to Be Collected for Multiple Times in the Input Configurations section.

Custom resource definition (CRD)
Create multiple CRDs. Each CRD defines a separate Logtail configuration that collects logs from the same file.