log-tailor

command module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

README

log-tailor

A command line program for tailing GCP logs.

Usage of ./log-tailor:
  -f value
    	Filter expression (multiple ok)
  -format string
        Format: json,yaml,csv (default "yaml")
  -l value
    	Log to tail (short name, multiple ok)
  -limit int
    	Number of entries to output. Defaults to MaxInt
  -p value
    	Project ID (multiple ok)

Command line args override values in the config. You can pass a YAML config in via stdin. Here's a simple example for now:

# all or drop-no-match (defaults to all)
match-rule: drop-no-match

projects:
- testing-proj

filters: []
# - protopayload.authenticationInfo.principalEmail = "system:gcp-controller-manager"

common-output:
- timestamp: timestamp
- project: resource.labels.project_id
- log-name:
    src: logname
    regex: projects/.*?/logs/(.*)
    value: $1
- resource-type: resource.type
- labels: resource.labels

logs:
- name: cloudaudit.googleapis.com/activity
  output:
  - payload: payload.protopayload
  - principalEmail: payload.protopayload.authenticationInfo.principalEmail
- name: cloudaudit.googleapis.com/data_access
  output:
  - payload: payload.protopayload

Where it is now

You can specify logs, filters, projects, and output formats. If you want to customize (tailor) the output, you can specify a YAML config that maps values from the log entries to keys and values in the output.

Where it may go

Right now it's project-based. There are logs at the billing-account and folder and organization level too. Support for those needs to be added.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL