All Projects → vogo → logtail

vogo / logtail

Licence: Apache-2.0 license
logtail is a log tailing utility, support tailing multiple commands output stream, transferring matching content to file/webhook(like dingtalk)

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
Makefile
30231 projects

Projects that are alternatives of or similar to logtail

tailor
Tailor, the library for tailing logs under logrotate, written in go.
Stars: ✭ 35 (+6.06%)
Mutual labels:  log, tail
Laravel Tail
An artisan command to tail your application logs
Stars: ✭ 587 (+1678.79%)
Mutual labels:  log, tail
logs-monitor
An application like Linux tail for Windows. Using Windows FindFirstChangeNotification API to monitoring file changes.
Stars: ✭ 43 (+30.3%)
Mutual labels:  log, tail
Flow
A realtime log analyzer
Stars: ✭ 69 (+109.09%)
Mutual labels:  log, tail
TailLog
实时日志(tail log)查看监控客户端工具
Stars: ✭ 79 (+139.39%)
Mutual labels:  log, tail
Open Log Viewer
A multi-platform log viewer built with Electron and styled with Material Design
Stars: ✭ 125 (+278.79%)
Mutual labels:  log, tail
aiologger
Asynchronous logging for Python and asyncio
Stars: ✭ 92 (+178.79%)
Mutual labels:  log
rust cms
使用Rust编写一个CMS(内容管理系统)可以做为个人博客,公司网站
Stars: ✭ 32 (-3.03%)
Mutual labels:  log
ng-logger
Angular logger service
Stars: ✭ 65 (+96.97%)
Mutual labels:  log
log
Aplus Framework Log Library
Stars: ✭ 14 (-57.58%)
Mutual labels:  log
fakessh
A dockerized fake SSH server honeypot written in Go that logs login attempts.
Stars: ✭ 42 (+27.27%)
Mutual labels:  log
PCPXlog
通过简单配置将日志同时输出到console、file、MongoDB | 可以pip安装
Stars: ✭ 13 (-60.61%)
Mutual labels:  log
Log
Daily logging tool and data visualizer.
Stars: ✭ 30 (-9.09%)
Mutual labels:  log
LogDelegate
Simple, pretty and powerful logger for android
Stars: ✭ 287 (+769.7%)
Mutual labels:  log
crab
Golang API Framework
Stars: ✭ 57 (+72.73%)
Mutual labels:  log
woodpecker-client
异常日志收集客户端 环境隔离版本
Stars: ✭ 51 (+54.55%)
Mutual labels:  log
loggie
A lightweight, cloud-native data transfer agent and aggregator
Stars: ✭ 844 (+2457.58%)
Mutual labels:  log
k3log
三大王日志,一款开箱即用且高效,快捷,安全的golang日志,基于uber zap
Stars: ✭ 32 (-3.03%)
Mutual labels:  log
LogESP
Open Source SIEM (Security Information and Event Management system).
Stars: ✭ 162 (+390.91%)
Mutual labels:  log
base
小而美的业务基础框架,也是本项目的核心
Stars: ✭ 47 (+42.42%)
Mutual labels:  log

logtail is a log tailing utility.

codecov GoDoc license

1. Features

  • tailing command output
  • support watch files under directory/sub-directories
  • support (dynamically) multiple commands tailing
  • support websocket tailing
  • support log matching filter
  • support transfer log to console/file/webhook (include dingtalk)

2. Architecture

3. Usage

3.2. install logtail

go install github.com/vogo/logtail@master

3.2. StartLoop logtail server using config file

logtail -file <config-file>

config file examples.

3.3. StartLoop logtail server and config using webapi

usage: logtail -port=<port>

# start at port 54321
logtail -port=54321

Then config using web api from web page http://<server-ip>:<port>/manage.

And you can browse http://<server-ip>:<port> to list all tailing logs.

4. log format

You can config log format globally, or config it for a server.

The config prefix of the format is the wildcard of the prefix of a new log record, logtail will check whether a new line is the StartLoop of a new log record, or one of the following lines.

The wildcard does NOT support '*' for none or many chars, it supports the following tag:

  • '?' as one byte char;
  • '~' as one alphabet char;
  • '!' as one number char;
  • other chars must exact match.

example:

{
    "default_format":{
      "prefix": "!!!!-!!-!!"  # global format config, Matches 2020-12-12
    },
    "servers": [
        {
          "name": "app1",
          "command": "tail -f /logs/app/app1.log",
          "format":{
            "prefix": "!!!!-!!-!!" # server format config, Matches 2020-12-12
          }
        }
    ]
}

4. command examples

The following are some useful commands which can be used in logtail.

# tail log file
tail -f /usr/local/myapp/myapp.log

# k8s: find and tail logs for the single pod of myapp
kubectl logs --tail 10 -f $(kubectl get pods --selector=app=myapp -o jsonpath='{.items[*].metadata.name}')

# k8s: find and tail logs for the myapp deployment (multiple pods)
kubectl logs --tail 10 -f deployment/$(kubectl get deployments --selector=project-name=myapp -o jsonpath='{.items[*].metadata.name}')

# k8s: find and tail logs for the latest version of the myapp deployment (single pod)
s=$(kubectl get deployments --selector=project-name=myapp -o jsonpath='{.items[*].metadata.name}');s=${s##* };kubectl logs --tail 10 -f deployment/$s

# k8s: find and tail logs for the latest version of the myapp deployment (multiple pods)
app=$(kubectl get deployments --selector=project-name=myapp -o jsonpath='{.items[*].metadata.name}');app=${app##* };pods=$(kubectl get pods --selector=app=$app -o jsonpath='{.items[*].metadata.name}');cmd='';for pod in $pods; do cmd=$cmd'kubectl logs --tail 2 -f pod/'$pod$'\n'; done;cmd=${cmd::-1}; echo "$cmd"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].