Available in Classic and VPC
You might run into the following problems when using Cloud Log Analytics: Find out causes and possible solutions.
Delete logs
I want to delete logs.
Cause
Logs stored in Cloud Log Analytics cannot be deleted arbitrarily.
Solution
You cannot arbitrarily delete logs. After the retention period (up to 30 days), logs are automatically deleted starting with the oldest. For more information, see Cloud Log Analytics prerequisites.
Disable log collection
I am using Cloud DB for MySQL but do not want to use the log collection feature.
Cause
Cloud DB services collect and provide Error logs and Slow Query logs by integrating with Cloud Log Analytics. Cloud DB requires Cloud Log Analytics, so you cannot unsubscribe from Cloud Log Analytics or delete logs.
Solution
You cannot disable the integration with Cloud Log Analytics while using Cloud DB.
View filebeat logs
After installing the collection agent, I want to check on the server if logs are being sent properly by viewing filebeat logs.
Cause
filebeat logs are configured not to generate log files.
Solution
To retain log files:
- Add the following content at the end of the
/etc/filebeat/filebeat.ymlfile:
logging.level: debug
logging.to_stderr: false
logging.to_syslog: false
logging.to_files: true
logging.files:
path: /var/log/filebeat
name: filebeat
keepfiles: 7
permissions: 0644
- Restart the agent.
sudo systemctl restart filebeat.service
- Check the error message in the log file created in the
/var/log/filebeatpath.
- Up to 7 log files are created and rotated, so disk usage does not continue to increase. If you need to reduce disk usage further, set to
logging.level: errorandkeepfiles: 3and check the result. After checking, remove the setting you added. - Do not directly modify settings configured in the console, such as the log collection path and the collection server address, in the
filebeat.ymlfile. For more information, see Unable to collect specific logs.
Log transfer error
I installed the agent and saw the "Finish Installation" message, but the logs aren't being sent.
Cause
Log display issues fall into the following categories. Check the items for the applicable case first.
| Display status | Items to check |
|---|---|
| Unable to view any logs. | See the solution below |
| Template logs (SYSLOG, Security, etc.) are displayed normally, but Custom Log is not displayed. | Unable to collect specific logs |
| Some log types do not appear in the Log Type list in Search, or logs are not displayed immediately after they are generated. | Unable to view collected logs |
The causes of logs not being sent at all are as follows:
| Cause | How to check |
|---|---|
| Agent (filebeat) process is not running. | filebeat does not appear in the process list search result. |
Communication with the collection server is blocked by a firewall, ACG, or iptables settings on the server. |
Failed to connect to the 5043 port on the collection server. |
| The installation server port is allowed, but the collection server port is not allowed. | Installation is complete, but connection to the 5043 port on the collection server fails. |
| Agent configuration file is not created or collection server address is missing. | Configuration file or output.logstash.hosts value is missing. |
| The server created by the image of the server with the agent installed. | The agent installed for the previous server is still present. |
Solution
Check the following items in order and take the appropriate action:
- Check whether the agent process is running.
ps -ef | grep filebeat
- If the process is not running, restart it using the
sudo systemctl restart filebeat.servicecommand.
- Check whether the agent configuration file has been created and contains the collection server address.
ls -altr /etc/filebeat/filebeat.yml
cat /etc/filebeat/filebeat.yml
- If the file does not exist or is empty, rerun the installation command from the console on the server.
- The
output.logstash.hostsentry must contain the collection server address and port.
- Check whether the server can communicate with the collection server. The collection server port is
5043/TCP.
telnet {collection server port} 5043
- On Windows servers, use the
Test-NetConnection {collection-server-address} -Port 5043command. - The collection server address is the
output.logstash.hostsvalue from step 2.
The installation/management server used to install the agent is separate from the collection server used to send logs, and the two servers use different ports. If only 80/TCP is allowed for the installation/management server, the installation completes, but logs are not sent. Allow communication with both servers.
- If communication fails, allow outbound traffic to the relevant address and port in the ACG or firewall. If you use
iptableson the server, register the allowed target as the destination. - If the server was created from an image with the agent already installed, the agent from the previous server may remain and prevent logs from being sent. Remove the agent, then reinstall it using the installation command issued from the server's Management page.
- If logs are still not sent after checking all the items above, view filebeat logs to collect diagnostic logs, then contact Customer Support with the error message from the
/var/log/filebeatpath.
Unable to collect specific logs
Logs configured with templates such as SYSLOG and Security are displayed, but Custom Log is not displayed.
Cause
If only some logs are not collected, the issue is not with the agent itself but with the collection settings for the relevant Log Type or the target files. The causes are as follows:
| Cause | How to check |
|---|---|
| Console collection settings are not applied to the server. | Log path is missing from the paths item in the configuration file. |
| File name is not specified in the path. | The paths item specifies a directory only. |
| There is a typo in the path or file name. | The string in the paths item does not match the actual file name. |
| Target file does not exist. | No file exists in the specified path. |
| Symbolic link target file is replaced. | Fixed link file name is specified. |
| Non-text file is specified. | Binary or compressed file is specified. |
| There are insufficient permissions to read the log file. | Agent is installed using an account without root privileges. |
Solution
1. Check whether the collection settings have been applied
This is the most common cause. After adding a log for collection or changing its path in the console, rerun the installation command shown on the Management page to apply the changes to the agent configuration file.
- Check whether the configuration file contains the path of the log that is not being collected.
cat /etc/filebeat/filebeat.yml
- If the path is missing from the
pathsitem, copy the installation command for the server from the console and run it again.
Do not edit the collection path directly in the filebeat.yml file. The values used for authentication are generated on the server during installation. Editing the file directly may cause its contents to differ from the collection settings in the console, preventing logs from being collected.
2. Check the collection path and target file
- Check whether the
pathsitem in the configuration file contains only a directory path. Logs are collected on a per-file basis, so the path must include a file name or file name pattern.
- Examples that are not collected:
/home/nginx/log - Examples that are collected:
/home/nginx/log/access*.log
- Check whether the string in the
pathsitem matches the actual file name. Use the following command to check whether the file exists in the specified path.
ls -altr {log path}
- If the collection target is a symbolic link whose target file is replaced periodically, use a pattern for the actual log file name instead of the fixed link file name.
- After changing the path, rerun the installation command as described in step 1.
For rules and examples for entering log paths, see Management.
3. Check the target file format
The agent collects text files only. Binary files (such as wtmp, btmp, and lastlog) and compressed files are not collected properly even if they are specified as collection targets. Specify log files written in text format.
4. Check the account used to install the agent
If the agent was installed using an account that does not have read access to some log files, those logs may not be collected In this case, changing the log file permissions does not resolve the issue, so reinstall the agent with root privileges.
5. Additional checks
If logs are still not collected after checking all the items above, view filebeat logs to collect diagnostic logs, then contact Customer Support with the error message from the /var/log/filebeat path.
Unable to view collected logs
Some collected logs do not appear on the Search page.
Cause
The following are all normal behaviors and do not indicate a log collection failure:
| Situation | Cause |
|---|---|
| A specific log type does not appear in the Log Type list in Search. | Only the 5 log types with the highest log volume appear in the list. |
| Unable to view recently generated logs. | Delay between log transmission and indexing or search availability. |
| Unable to view previous entries from rolling logs specified with wildcards. | Only content added after the agent's last read position is sent. |
Solution
- Only the 5 log types with the highest log volume appear in the Log Type list in Search. A log type not appearing in the list does not mean the corresponding logs are not being collected. To check whether logs are being collected, navigate to Menu > All Services > Management & Governance > Cloud Log Analytics > Management and check the collection settings. For details on search conditions and how results are displayed, see Search.
- Logs may take some time to appear in search results after being sent. If logs do not appear immediately after they are generated, check again after a short while.
- When you collect rolling logs using wildcards, the agent tracks the last read position in each file and sends only content added afterward. Logs are not duplicated or omitted when a file is created or replaced.
If you're still having trouble finding what you need, click on the feedback icon and send us your thoughts and requests. We'll use your feedback to improve this guide.