Git Product home page Git Product logo

plywood's Introduction

Plywood

Plywood is a log combiner. It accepts as input multiple files and produces a single output stream on stdout. Each line of input should start with a timestamp so that logs can be sorted. The first line of a log file determines the timestamp format for the entire file. If a timestamp is not understood, then that entire file will be at the beginning of output, and each line will start with 'z'.
If the environment variable PLYWOOD is set, then that file name will be loaded to enable custom runtime formatters.

The -showDefaults flag will print the default formatters in the correct format to be loaded. See https://golang.org/pkg/time/#Parse for details on the time layout format. When defining custom formatters you must provide a sample line and the expected output. Plywood will always format the output time in UTC.

Flags

  • -a Show absolute timestamp. Defaults to false
  • -r Hide relative timestamp. Defaults to false
  • -showDefaults Print the default timestamp formats

Usage

plywood one.log two.log > plywood.log

Example custom time format

[
  {
    "Name": "Use the optional name key to give commentary on this format",
    "Regex": "([\\d-]* [\\d:.]* [+-]?\\d* [^ ]*)",
    "TimeFormat": "2006-01-02 15:04:05.999999999 -0700 MST",
    "ExampleLine": "2020-10-19 19:19:17.497204 +1300 NZDT line1 ",
    "ExpectedOutput": "2020-10-19 07:19:17.497 [test] line1 \n"
  }
]

plywood's People

Contributors

bradbev avatar

Watchers

 avatar James Cloos 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.