https://github.com/frobware/bpfman-pod-log-defluffer
Pod log noise reduction tool.
https://github.com/frobware/bpfman-pod-log-defluffer
Last synced: 4 months ago
JSON representation
Pod log noise reduction tool.
- Host: GitHub
- URL: https://github.com/frobware/bpfman-pod-log-defluffer
- Owner: frobware
- License: mit
- Created: 2024-08-13T17:48:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-13T18:12:20.000Z (over 1 year ago)
- Last Synced: 2025-02-24T07:38:22.550Z (about 1 year ago)
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bpfman-pod-log-defluffer
## Description
`bpfman-pod-log-defluffer` is a command-line tool designed to improve the readability of JSON log entries generated by the `bpfman` operator and daemon.
## Purpose
`bpfman-pod-log-defluffer` was created to address the challenge of interpreting dense, unformatted logs which often appear as a giant wall of text. This tool helps to make logs more accessible and easier to understand.
## Features
- **Enhanced Readability:** Outputs each key-value pair on a new line, making `bpfman` logs easier to scan and interpret.
- **Compact Format Option:** Use the `-s` flag to condense the output into a single line, stripping out JSON meta characters like braces, brackets, and commas for a streamlined view.
- **Sorted Log Entries:** Fields in log entries are sorted case-insensitively to further enhance readability.
## Installation
To install `bpfman-pod-log-defluffer`, use the `go install` command.
```bash
go install github.com/frobware/bpfman-pod-log-defluffer@latest
```
The binary will be placed in your `$GOPATH/bin` directory.
## Usage
### Processing daemon logs
```sh
oc logs -n bpfman bpfman-daemon-vgwcd -c bpfman-agent | bpfman-pod-log-defluffer
```
```console
2024-08-13T13:03:36Z info setup: "Waiting for active connection to bpfman"
2024-08-13T13:03:36Z info setup: "starting Bpfman-Agent"
2024-08-13T13:03:36Z info controller-runtime.metrics: "Starting metrics server"
2024-08-13T13:03:36Z info controller-runtime.metrics: "Serving metrics server"
bindAddress: 127.0.0.1:8174
secure: false
2024-08-13T13:03:36Z info: "starting server"
addr: [::]:8175
name: health probe
2024-08-13T13:03:36Z info: "starting server"
addr: [::]:6060
name: pprof
2024-08-13T13:03:36Z info: "Starting EventSource"
controller: xdpprogram
controllerGroup: bpfman.io
controllerKind: XdpProgram
source: kind source: *v1alpha1.XdpProgram
2024-08-13T13:03:36Z info: "Starting EventSource"
controller: tcprogram
controllerGroup: bpfman.io
controllerKind: TcProgram
source: kind source: *v1alpha1.TcProgram
2024-08-13T13:03:36Z info: "Starting EventSource"
controller: xdpprogram
controllerGroup: bpfman.io
controllerKind: XdpProgram
source: kind source: *v1alpha1.BpfProgram
```
### Processing operator logs
```sh
oc logs -c bpfman-operator -n bpfman bpfman-operator-f967f7657-w28vq | bpfman-pod-log-defluffer
```
```console
2024-08-13T09:32:11Z INFO setup Discovering APIs
2024-08-13T09:32:11Z INFO setup detected platform version
PlatformVersion: v1.29.2
2024-08-13T09:32:11Z INFO setup starting manager
2024-08-13T09:32:11Z INFO controller-runtime.metrics Starting metrics server
2024-08-13T09:32:11Z INFO controller-runtime.metrics Serving metrics server
bindAddress: 127.0.0.1:8174
secure: false
2024-08-13T09:32:11Z INFO starting server
addr: [::]:8175
name: health probe
I0813 09:32:11.127177 1 leaderelection.go:250] attempting to acquire leader lease bpfman/8730d955.bpfman.io...
I0813 09:32:11.135745 1 leaderelection.go:260] successfully acquired lease bpfman/8730d955.bpfman.io
2024-08-13T09:32:11Z DEBUG events bpfman-operator-f967f7657-w28vq_27460b5f-97a2-4ccc-a1c9-fd92f43e0e5e became leader
object.apiVersion: coordination.k8s.io/v1
object.kind: Lease
object.name: 8730d955.bpfman.io
object.namespace: bpfman
object.resourceVersion: 568
object.uid: 4dc169c4-d769-410c-9760-88c507fb9e25
reason: LeaderElection
type: Normal
2024-08-13T09:32:11Z INFO Starting EventSource
controller: configmap
controllerGroup:
controllerKind: ConfigMap
source: kind source: *v1.ConfigMap
2024-08-13T09:32:11Z INFO Starting EventSource
controller: fexitprogram
controllerGroup: bpfman.io
controllerKind: FexitProgram
source: kind source: *v1alpha1.FexitProgram
2024-08-13T09:32:34Z DEBUG updateCondition()
controller: xdpprogram
controllerGroup: bpfman.io
controllerKind: XdpProgram
existing conds[0].lastTransitionTime: 2024-08-13T09:32:34Z
existing conds[0].message: Waiting for Program Object to be reconciled to all nodes
existing conds[0].reason: ProgramsNotYetLoaded
existing conds[0].status: True
existing conds[0].type: NotYetLoaded
name: go-xdp-counter-example
namespace:
new cond: ReconcileError
reconcileID: bd3030d8-731a-4388-b57e-7f849b0ad397
XdpProgram.name: go-xdp-counter-example
```