我 现在想用shell脚本来修改filebeat采集文件时记录的registry文件中的offset值,请问如何使用shell命令来操作呢?
registry文件内容如下(我可怎么样使用脚本把某个文件的offset值进行修改?):
[{"source":"/testdir/log/test/sa.txt","offset":9141,"FileStateOS":{"inode":142414474,"device":64770},"timestamp":"2019-04-10T15:40:22.88882031+08:00","ttl":-1},{"source":"/testdir/log/test/sa111.txt","offset":38528,"FileStateOS":{"inode":142414466,"device":64770},"timestamp":"2019-04-10T15:40:22.888822047+08:00","ttl":-1}]
registry文件内容如下(我可怎么样使用脚本把某个文件的offset值进行修改?):
[{"source":"/testdir/log/test/sa.txt","offset":9141,"FileStateOS":{"inode":142414474,"device":64770},"timestamp":"2019-04-10T15:40:22.88882031+08:00","ttl":-1},{"source":"/testdir/log/test/sa111.txt","offset":38528,"FileStateOS":{"inode":142414466,"device":64770},"timestamp":"2019-04-10T15:40:22.888822047+08:00","ttl":-1}]
0 个回复