문제

Since file input is buggy for logstash on Solaris, I am trying to use the pipe input instead. A configuration based on a "tail -f" works great, but the problem is that the file is being rolled over every time it reaches 20MB, which happens about once a week.

So I googled for a way of tailing tolerating rollover and found that tail -F would be the solution... if that command was available on Solaris 10. I also found a shell script that could do the trick, but the permanent cpu consumption of 1.5% is quite dissuasive.

So I am looking for alternatives. Ideally I would rather not have to install third-party software which requires administration privileges I don't own, or which requires recompilation since there is a very low probability for it to work (there is always some lib version requirement which fails).

I am considering using an enhanced perl script like we can find some when googling on the topic or even make a java interface (but not sure it would cost less resources than the shell script), but before that I was wondering if there was a simpler way around.

How did you do before the -F flag was introduced?

도움이 되었습니까?

해결책

You should take a look at Perl Power Tools, a project to "reimplement the classic Unix command set in pure Perl". tail is one of the commands that the project implements.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top