项目作者: sentinelleader

项目描述 :
A Recursive Log Forwarder
高级语言: Go
项目地址: git://github.com/sentinelleader/tailr.git
创建时间: 2017-05-07T21:15:21Z
项目社区:https://github.com/sentinelleader/tailr

开源协议:

下载


Tailr - A Recursive Log Forwarder

Build Status

Tailr watches a folder recursively for files matching a specified pattern. If the file exists it will start reading the file contents and forwards the same in realtime to a remote server. Tailr can detect any new files/directories that gets created with in the watching directory. It will automatically start watching all dicrectories and files that gets created with in the new sub directories. It also automatically stops watching if a file/directory is removed.

Tailr also comes with an optional file offset feature where it keeps track of the file offset for each file that it keeps tracks off. If the file offset is enabled and application gets restarted, Tailr will start reading the files from where it stopped previously instead of re-reading the file from the begining.

Tailr also comes with a noop output option. If -noop flag is passed, Tailr will redirect all the forwarded logs to STDOUT instead of forwarding to the remote server.

  1. $ tailr -h
  2. Usage of tailr:
  3. -logDir string
  4. path to log directory (default "/tmp/logs")
  5. -logPattern string
  6. log pattern to look for (default "*.log")
  7. -noop
  8. prints the output to stdout
  9. -offsetFilePath string
  10. path to offset file store (default "/tmp/tailr-offset.json")
  11. -port string
  12. server port (default "9000")
  13. -protocol string
  14. tcp or udp (default "tcp")
  15. -server string
  16. server address (default "localhost")
  17. -useOffset
  18. whether to use file offset method or not (default true)

Installing

  1. $ make
  2. or
  3. $ bazel build //:tailr

TODO

  • Support to more remote output server like Redis/Elastisearch etc …