开发者

Parsing a log file help

I'm trying to write a either bash or perl script which runs twice a day that copies the last entry in a log and takes only the numbers and copies and replaces the value in a .dat file with those numbers. The format in 开发者_开发技巧the log is:

(Event{id=275800).

Thanks in advance!


tail -n 1 logfile.log | sed 's/.*id=\([^)]\+\).*/\1/' > file.dat

would be the bash command for it, as for twice a day a cronjob would be the easiest I think.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜