logstash 定时任务
时间: 2023-09-14 11:11:06 浏览: 202
可以使用crontab命令来设置logstash的定时任务。在给定的引用中,可以看到一个示例,它将在每天晚上11点50分启动logstash接收日志,并在每天凌晨1点关闭logstash。具体的crontab命令如下:
```
crontab -e
```
然后在打开的编辑器中添加以下两行:
```
50 23 * * * /usr/local/sh/logstash.sh
* 1 * * * /usr/local/sh/stopLogstash.sh
```
这将在指定的时间执行相应的脚本文件来启动和关闭logstash。如需了解更多关于crontab的使用,可以参考相关文档。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Filebeat Logstash crontab 定时采集日志](https://blog.csdn.net/qq_25388339/article/details/103821729)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [LogStash定时同步 MySql/Oralce 到ElasticSearch](https://blog.csdn.net/weixin_44400823/article/details/125481452)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文