If an exception occurs during the log collection, you can use the Logtail automatic diagnosis tool to check if an exception exists in the client and troubleshoot the problem quickly as instructed by the tool.
If the Logtail heartbeat status is Fail, see Logtail heartbeat error.
--help: View help document.
--logFile [LogFileFullPath]: Check if Logtail collects logs from
LogFileFullPathand check the basic running environment of Logtail such as installation file integrity, running status, Alibaba Cloud user ID, and network connectivity.
--logFileOnly [LogFileFullPath]: Only check if Logtail collects logs from
--envOnly: Only check the running environment of Logtail.
Run the script
./checkingtool.sh --logFile [LogFileFullPath] to perform the check. If the script detects an exception, proceed as instructed by the script.
Note: If the specific log file passes the check and the Logtail running environment is normal, we recommend that you log on to the Alibaba Cloud console to view the configuration exception logs of Log Service. For more information, see Query log collection errors.
You can find the causes of Logtail log collection errors by running the Logtail quick diagnosis tool and then use the corresponding solution to solve the problem. The causes and solutions of common Logtail log collection errors are as follows.
|Installation file is missing||Reinstall Logtail.|
|Logtail is not running||Use the command
|Multiple Logtail processes||Use the command
|Port 443 is disabled||Open the port 443 in the firewall.|
|Cannot find the configuration server||Check if the installation is correct. If not, uninstall and then reinstall Logtail.|
|User configuration does not exist||Confirm that the Logtail configuration is created in the console, the machine group contains the client, and the configuration is applied to the machine group.|
|The specified log file is not matched||Check if the Logtail configuration is correct.|
|The specified log file is matched more than once||Logtail selects one configuration randomly when multiple matches exist. We recommend that you retain only one configuration that matches the specified log file.|
The Alibaba Cloud ID and dynamic machine group/user-defined identity configured in the client are output when the diagnosis tool is running. No alarm is triggered if they do not exist. If the client requires the configuration of Alibaba Cloud ID or dynamic machine group/user-defined identity, check if the output of the tool and your configuration are the same. If not, reconfigure them as described in Collect logs from non-Alibaba Cloud ECS instances or ECS instances not in your account and Configure a user-defined identity for a machine group.
The diagnosis tool must use curl to check the network connectivity. Make sure the machine has the curl tool installed.