All Projects → dtan4 → K8stail

dtan4 / K8stail

Licence: mit
tail -f experience for Kubernetes Pods

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to K8stail

KTail
Kubernetes log viewer
Stars: ✭ 32 (-72.88%)
Mutual labels:  tail
Stern
⎈ Multi pod and container log tailing for Kubernetes
Stars: ✭ 5,614 (+4657.63%)
Mutual labels:  tail
Tail
[Revamped] Go package for reading from continuously updated files (tail -f)
Stars: ✭ 81 (-31.36%)
Mutual labels:  tail
fdlinecombine
Read multiple fds and print data to stdout linewise.
Stars: ✭ 40 (-66.1%)
Mutual labels:  tail
Honeypot
Low interaction honeypot that displays real time attacks
Stars: ✭ 348 (+194.92%)
Mutual labels:  tail
Monstache
a go daemon that syncs MongoDB to Elasticsearch in realtime
Stars: ✭ 736 (+523.73%)
Mutual labels:  tail
pushover-cli
pushover-cli is a command line client for https://pushover.net to send pushover notifications. Moreover it is possible with this client to pipe streams directly to your cellphone like tail -f /var/log/my.log | pushover-cli -
Stars: ✭ 38 (-67.8%)
Mutual labels:  tail
Pg tail
' tail -f ' your PostgreSQL tables.
Stars: ✭ 106 (-10.17%)
Mutual labels:  tail
Cw
The best way to tail AWS CloudWatch Logs from your terminal
Stars: ✭ 368 (+211.86%)
Mutual labels:  tail
Flow
A realtime log analyzer
Stars: ✭ 69 (-41.53%)
Mutual labels:  tail
Snaketail Net
Tail utility for monitoring text log files and Windows EventLog
Stars: ✭ 260 (+120.34%)
Mutual labels:  tail
Node Tail
The zero dependency Node.js module for tailing a file
Stars: ✭ 335 (+183.9%)
Mutual labels:  tail
Locktail
Lock tailing on your rotating files
Stars: ✭ 8 (-93.22%)
Mutual labels:  tail
TailLog
实时日志(tail log)查看监控客户端工具
Stars: ✭ 79 (-33.05%)
Mutual labels:  tail
Kail
kubernetes log viewer
Stars: ✭ 1,259 (+966.95%)
Mutual labels:  tail
tailf
tail -f written in Scala
Stars: ✭ 28 (-76.27%)
Mutual labels:  tail
Laravel Tail
An artisan command to tail your application logs
Stars: ✭ 587 (+397.46%)
Mutual labels:  tail
Gtm
gtm (go tail mongo) is a MongoDB event listener
Stars: ✭ 110 (-6.78%)
Mutual labels:  tail
Frontail
📝 streaming logs to the browser
Stars: ✭ 1,387 (+1075.42%)
Mutual labels:  tail
Saw
Fast, multi-purpose tool for AWS CloudWatch Logs
Stars: ✭ 1,071 (+807.63%)
Mutual labels:  tail

k8stail

GitHub Actions Dependabot Status codecov Docker Repository on Quay GitHub release

tail -f experience for Kubernetes Pods

As you know, kubectl logs can stream only ONE pod at the same time. k8stail enables you to watch log streams of ALL pods in the specified namespace or labels in real time, like tail -f.

example

Table of Contents

Requirements

Kubernetes 1.3 or above

Installation

Using Homebrew (OS X only)

Formula is available at dtan4/homebrew-dtan4.

$ brew tap dtan4/dtan4
$ brew install k8stail

Precompiled binary

Precompiled binaries for Windows, OS X, Linux are available at Releases.

From source

$ go get -d github.com/dtan4/k8stail
$ cd $GOPATH/src/github.com/dtan4/k8stail
$ make deps
$ make install

Run in a Docker container

Docker image is available at quay.io/dtan4/k8stail.

# -t is required to colorize logs
$ docker run \
    --rm \
    -t \
    -v $HOME/.kube/config:/.kube/config \
    quay.io/dtan4/k8stail:latest \
      -kubeconfig=/.kube/config

Usage

Logs of all pods, all containers in pod in the specified namespace are streaming. When new pod is added, logs of the pod also appears. To stop streaming and exit, press Ctrl-C.

$ k8stail --namespace awesome-app
Namespace: awesome-app
Labels:
----------
Pod awesome-app-web-4212725599-67vd4 has detected
Pod awesome-app-web-4212725599-6pduy has detected
Pod awesome-app-web-4212725599-lbuny has detected
Pod awesome-app-web-4212725599-mh3g1 has detected
Pod awesome-app-web-4212725599-pvjsm has detected
[awesome-app-web-4212725599-mh3g1][web]  | creating base compositions...
[awesome-app-web-4212725599-zei9h][web]  |    (47.1ms)  CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
[awesome-app-web-4212725599-zei9h][web]  |    (45.1ms)  CREATE UNIQUE INDEX  "unique_schema_migrations" ON "schema_migrations"  ("version")
[awesome-app-web-4212725599-zei9h][web]  |   ActiveRecord::SchemaMigration Load (1.8ms)  SELECT "schema_migrations".* FROM "schema_migrations"
[awesome-app-web-4212725599-zei9h][web]  | Migrating to CreatePosts (20160218082522)

With --timestamps option, log timestamp is printed together.

$ k8stail --namespace awesome-app --timestamps
Namespace: awesome-app
Labels:
----------
Pod awesome-app-web-4212725599-67vd4 has detected
Pod awesome-app-web-4212725599-6pduy has detected
Pod awesome-app-web-4212725599-lbuny has detected
Pod awesome-app-web-4212725599-mh3g1 has detected
Pod awesome-app-web-4212725599-pvjsm has detected
[awesome-app-web-4212725599-mh3g1][web] 2016-11-15T10:57:22.178667425Z  | creating base compositions...
[awesome-app-web-4212725599-zei9h][web] 2016-11-15T10:57:22.309011520Z  |    (47.1ms)  CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
[awesome-app-web-4212725599-zei9h][web] 2016-11-15T10:57:22.309053601Z  |    (45.1ms)  CREATE UNIQUE INDEX  "unique_schema_migrations" ON "schema_migrations"  ("version")
[awesome-app-web-4212725599-zei9h][web] 2016-11-15T10:57:22.463700110Z  |   ActiveRecord::SchemaMigration Load (1.8ms)  SELECT "schema_migrations".* FROM "schema_migrations"
[awesome-app-web-4212725599-zei9h][web] 2016-11-15T10:57:22.463743373Z  | Migrating to CreatePosts (20160218082522)

With --labels option, you can filter pods to watch.

$ k8stail --namespace awesome-app --labels name=awesome-app-web
Namespace: awesome-app
Labels:    name=awesome-app-web
----------
Pod awesome-app-web-4212725599-67vd4 has detected
Pod awesome-app-web-4212725599-6pduy has detected
Pod awesome-app-web-4212725599-lbuny has detected
Pod awesome-app-web-4212725599-mh3g1 has detected
Pod awesome-app-web-4212725599-pvjsm has detected
[awesome-app-web-4212725599-mh3g1][web]  | creating base compositions...
[awesome-app-web-4212725599-zei9h][web]  |    (47.1ms)  CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
[awesome-app-web-4212725599-zei9h][web]  |    (45.1ms)  CREATE UNIQUE INDEX  "unique_schema_migrations" ON "schema_migrations"  ("version")
[awesome-app-web-4212725599-zei9h][web]  |   ActiveRecord::SchemaMigration Load (1.8ms)  SELECT "schema_migrations".* FROM "schema_migrations"
[awesome-app-web-4212725599-zei9h][web]  | Migrating to CreatePosts (20160218082522)

kubeconfig file

k8stail uses ~/.kube/config as default. You can specify another path by KUBECONFIG environment variable or --kubeconfig option. --kubeconfig option always overrides KUBECONFIG environment variable.

$ KUBECONFIG=/path/to/kubeconfig k8stail
# or
$ k8stail --kubeconfig=/path/to/kubeconfig

Options

Option Description Required Default
--context=CONTEXT Kubernetes context
--debug Debug mode using pprof (http://localhost:6060) false
--kubeconfig=KUBECONFIG Path of kubeconfig ~/.kube/config
--labels=LABELS Label filter query (e.g. app=APP,role=ROLE)
--namespace=NAMESPACE Kubernetes namespace default
--timestamps Include timestamps on each line false
-h, -help Print command line usage
-v, -version Print version

Development

Go 1.7 or above is required.

Clone this repository and build using make.

$ go get -d github.com/dtan4/k8stail
$ cd $GOPATH/src/github.com/dtan4/k8stail
$ make

Author

Daisuke Fujita (@dtan4)

License

MIT License

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].