Giter VIP home page Giter VIP logo

spout's Introduction

spout

spout is a lightweight log viewer for cloud service logs.

spout

Features

  • Quick filtering by jq
  • Invoke from command line with pre-defined options
  • Support multiple log sources
    • Google Cloud Logging and JSON formatted local file for now

Installation

From releases

Download a binary for your platform from https://github.com/m-mizutani/spout/releases

Build

go install can not be used to install because of requiring npm. You can build spout by following steps.

$ git clone https://github.com/m-mizutani/spout.git
$ cd spout
$ cd frontend && npm install && npm run export && cd ..
$ go build .

Usage

Google Cloud Logging

Example of command line:

$ spout gcp --project <your-project-id> -d 10m --filter "resource.type=k8s_container"

Options:

   --addr value, -a value       Server address for browser mode (default: "127.0.0.1:3280") [$SPOUT_ADDR]
   --base-time value, -t value  Base time [$SPOUT_BASE_TIME]
   --duration value, -d value   Duration, e.g. 10m, 30s (default: "10m") [$SPOUT_DURATION]
   --filter value, -f value     Google Cloud Logging filter  (accepts multiple inputs) [$SPOUT_GCP_FILTER]
   --limit value                Limit of fetching log (default: 1000) [$SPOUT_GCP_LIMIT]
   --mode value, -m value       Run mode [console|browser] (default: "browser") [$SPOUT_MODE]
   --project value, -p value    Google Cloud Project ID [$SPOUT_GCP_PROJECT]
   --range value, -r value      Range type [before|after|around] (default: "before") [$SPOUT_RANGE]

Preset options

Save .spout.toml like following at current working directory.

[stg]
command = "gcp"
options = [
    "--limit", "100",
    "--project", "your-staging-service",
    "--filter", 'resource.type=k8s_container labels."k8s-pod/services_ubie_app/app"="your_app"',
]

[prd]
command = "gcp"
options = [
    "--limit", "100",
    "--project", "your-production-service",
    "--filter", 'resource.type=k8s_container labels."k8s-pod/services_ubie_app/app"="your_app"',
]

Then, you can call predefined options as following:

$ spout call prd # means 'gcp --limit 100 --project your-production-service ...'
$ spout call prd --filter "user_20352904853" # Append '--filter "user_20352904853"' to existing prd options

License

Apache version 2.0

spout's People

Contributors

m-mizutani avatar

Stargazers

Ivan K avatar  avatar Harvey avatar よっこい avatar Narimichi Takamura avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.