Updated at: 2022-12-09 03:49:50
You can monitor the changes of the same type of log files in one or more folders through a script, to automatically generate Rsyslog configuration file script for Rsyslog streaming upload. The specific steps are as follows:
1. Find the directory of the script: cd /anyrobot-installer/anyrobot/tools/rsyslog_upload_directory
2. Create Rsyslog monitoring task, with reference command as follows:
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/Rsyslog%E7%9B%91%E6%8E%A7%E8%84%9A%E6%9C%AC_%E5%88%9B%E5%BB%BA_E-1.png)
3. View Rsyslog monitoring task as follows:
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/Rsyslog_%E6%9F%A5%E7%9C%8B%E7%9B%91%E6%8E%A7%E4%BB%BB%E5%8A%A1.png)
4. Delete Rsyslog monitoring task, as follows:
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/Rsyslog_%E5%88%A0%E9%99%A4%E7%9B%91%E6%8E%A7%E4%BB%BB%E5%8A%A1_E.png)
Note:
1. Two Rsyslog streaming upload scripts must be in the same path;
2. After the monitoring task is successfully created, it will take 1 minute to generate the configuration file by default. After the configuration file is generated, it means that the data has been uploaded (view path: /etc/rsyslog.d/ );
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/Rsyslog_%E7%9B%91%E6%8E%A7%E4%BB%BB%E5%8A%A1%E6%9F%A5%E7%9C%8B%E8%B7%AF%E5%BE%84.png)
3. It does not support monitoring log files with spaces in the file name;
4. After the configuration file is generated, check whether the log has been uploaded successfully by the following methods:
• Method 1: You can create a log group based on information such as the log source or port number, switch to the log group on the Search, and view the uploaded log;
• Method 2: Without creating a log group, you can directly filter and search by port and other information on the Search.
1. Find the directory of the script: cd /anyrobot-installer/anyrobot/tools/rsyslog_upload_directory
2. Create Rsyslog monitoring task, with reference command as follows:
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/Rsyslog%E7%9B%91%E6%8E%A7%E8%84%9A%E6%9C%AC_%E5%88%9B%E5%BB%BA_E-1.png)
3. View Rsyslog monitoring task as follows:
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/Rsyslog_%E6%9F%A5%E7%9C%8B%E7%9B%91%E6%8E%A7%E4%BB%BB%E5%8A%A1.png)
4. Delete Rsyslog monitoring task, as follows:
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/Rsyslog_%E5%88%A0%E9%99%A4%E7%9B%91%E6%8E%A7%E4%BB%BB%E5%8A%A1_E.png)
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/%E6%B3%A8%E6%84%8F%20(1)_21.png)
1. Two Rsyslog streaming upload scripts must be in the same path;
2. After the monitoring task is successfully created, it will take 1 minute to generate the configuration file by default. After the configuration file is generated, it means that the data has been uploaded (view path: /etc/rsyslog.d/ );
![](https://new-official-website-1256829807.cos.ap-shanghai.myqcloud.com/images/Rsyslog_%E7%9B%91%E6%8E%A7%E4%BB%BB%E5%8A%A1%E6%9F%A5%E7%9C%8B%E8%B7%AF%E5%BE%84.png)
3. It does not support monitoring log files with spaces in the file name;
4. After the configuration file is generated, check whether the log has been uploaded successfully by the following methods:
• Method 1: You can create a log group based on information such as the log source or port number, switch to the log group on the Search, and view the uploaded log;
• Method 2: Without creating a log group, you can directly filter and search by port and other information on the Search.
< Previous:
Next: >