Skip to content

Commit

Permalink
rename project to protokol
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed May 24, 2022
1 parent fd1242b commit cca26ea
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# loks - Collect Kubernetes Pod Logs with Ease
# protokol - Collect Kubernetes Pod Logs with Ease

`loks` is a command line tool to watch for pods and storing their logs as text files
`protokol` is a command line tool to watch for pods and storing their logs as text files
on your local machine. It's primarily intended to be used in test scenarios where you
need to gather logs of many different, possibly restarting or reconciled pods at the
same time.
Expand All @@ -11,17 +11,17 @@ same time.

## Installation

You can download a binary for the [latest release on GitHub](https://github.com/xrstf/loks/releases)
or install loks via Go:
You can download a binary for the [latest release on GitHub](https://github.com/xrstf/protokol/releases)
or install protokol via Go:

```bash
go install go.xrstf.de/loks
go install go.xrstf.de/protokol
```

## Usage

```
Usage of loks:
Usage of protokol:
-c, --container stringArray Container names to store logs for (supports glob expression) (can be given multiple times)
-f, --flat Do not create directory per namespace, but put all logs in the same directory
--kubeconfig string kubeconfig file to use (uses $KUBECONFIG by default)
Expand All @@ -36,48 +36,48 @@ Usage of loks:
## Examples

```bash
loks '*'
protokol '*'
```

This is the BFG: it will watch all Pods in all namespaces and stream the logs for each running container to
a text file in your disk. Don't do this, you do not want to kill the apiserver with a gazillion streams.

```bash
loks -n kube-system -n 'cluster-*'
protokol -n kube-system -n 'cluster-*'
```

You can restrict the Pods to a set of namespaces. Wildcards are allowed.

```bash
loks -l 'foo=bar'
protokol -l 'foo=bar'
```

Label selectors work just as you would expect.

```bash
loks 'kube-*' 'coredns-*' 'etcd-*'
protokol 'kube-*' 'coredns-*' 'etcd-*'
```

You can give multiple name patterns, placeholders are allowed.

```bash
loks -c 'test*' 'kube-*' 'coredns-*' 'etcd-*'
protokol -c 'test*' 'kube-*' 'coredns-*' 'etcd-*'
```

You can restrict the container names using `-c`. This flag can be given multiple times and also supports wildcards.

```bash
loks -o test 'kube-*' 'coredns-*' 'etcd-*'
protokol -o test 'kube-*' 'coredns-*' 'etcd-*'
```

By default loks will create a `loks-%Y%m%dT%m.%h%s` directory whenever you invoke it, but you can also specify
By default protokol will create a `protokol-%Y%m%dT%m.%h%s` directory whenever you invoke it, but you can also specify
a directory yourself.

```bash
loks -o test -f 'kube-*' 'coredns-*' 'etcd-*'
protokol -o test -f 'kube-*' 'coredns-*' 'etcd-*'
```

By default loks will create one directory per namespace. With `-f` (`--flat`) you can disable this behaviour.
By default protokol will create one directory per namespace. With `-f` (`--flat`) you can disable this behaviour.

## License

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.xrstf.de/loks
module go.xrstf.de/protokol

go 1.17

Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"time"

"go.xrstf.de/loks/pkg/collector"
"go.xrstf.de/loks/pkg/watcher"
"go.xrstf.de/protokol/pkg/collector"
"go.xrstf.de/protokol/pkg/watcher"

"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -89,7 +89,7 @@ func main() {
}

if opt.directory == "" {
opt.directory = fmt.Sprintf("loks-%s", time.Now().Format("2006.01.02T15.04.05"))
opt.directory = fmt.Sprintf("protokol-%s", time.Now().Format("2006.01.02T15.04.05"))
}

log.WithField("directory", opt.directory).Info("Storing logs on disk.")
Expand Down
2 changes: 1 addition & 1 deletion pkg/watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"sync"

"go.xrstf.de/loks/pkg/collector"
"go.xrstf.de/protokol/pkg/collector"

"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
Expand Down

0 comments on commit cca26ea

Please sign in to comment.