Flume 读取实时更新的日志文件
来源:互联网 发布:文案网站 知乎 编辑:程序博客网 时间:2024/06/05 15:32
http://blog.csdn.net/bright60/article/details/50728306
我用了第一种方法。
1. 日志文件每天roate一个新文件
a) 方案一
There is no way the tail command itself can automatically switch to the new file with a different name when the date changes. Thus, you have to kill the old tail and start a new one in due time.
while tail -F `date +%Y%m%d.log`& sleep $(expr `date +%s -d'day 0'` - `date +%s`)do kill $!done
b) 方案二
I am using flume-ng exec tailing rotated log files too. Here's my solution:
originAgent.sources.originSource2.type = exec originAgent.sources.originSource2.command = locktail_rotate.sh /path/to/test.DATE_ROTATE.log 'date +"%Y%m%d"'
And you can checkout locktail_rotate.sh from here. https://github.com/kylelin/locktail
另外一个参考: https://github.com/liuxuan207/TailSource
阅读全文
0 0
- Flume 读取实时更新的日志文件
- Flume 读取实时更新的日志文件
- flume+kafka读取日志文件
- Java实时读取日志文件
- Java实时读取日志文件
- 5.Flume实时监控读取日志数据,存储hdfs文件系统
- golang 实时读取日志文件,windows版本的tail
- 监听器监听日志,实时读取日志文件,把读取到的数据入库
- Java 线程实时读取日志文件
- java实时读取log日志文件
- Flume实时收集日志问题
- Flume+Kafka+Storm的实时日志统计
- Flume读取日志数据并写入到Kafka,ConsoleConsumer进行实时消费
- Flume+Elasticsearch搭建实时日志分析系统
- flume+RabbitMQ+Storm实时日志运算处理
- 实时日志流系统(kafka-flume-hdfs)
- flume实时收集日志到kafka
- 使用Log4j将日志实时写入Flume
- navicate11下无法显示Mysql中的json列
- mssql 2008 R2清理数据库日志方法
- Java多线程机制
- 通用的Java hashCode重写方案
- pip install mysql-connector-python-rf 出现... not recognised解决方案
- Flume 读取实时更新的日志文件
- 通俗易懂的Websocket原理
- 移动平均法(Moving average,MA) 指数平滑法(Exponential Smoothing,ES)
- tensorflow(一)
- android 圆形按钮结合selector和shape实现
- 23种设计模式逐个代码举例分析
- AngularJs用户列表的增删改查(2)
- Java正则表达式验证
- 数据结构的逻辑结构和物理结构