#log #command-line-tool #structured #table #aggregate #definition #describe

bin+lib qma

Simple command line tool for aggregate structured log

2 releases

0.1.1 Jun 5, 2022
0.1.0 May 29, 2022

#24 in #describe

MIT license

28KB
792 lines

QMA

Simple command line tool for aggeregate structured log.

Usage

Before runnning qma, prepare the yaml file which describe table definition config like below. See here to detail.

Query from log file.

qma <CONFIG_PATH> <LOG_FILE_PATH>

Query from stdout

SOME COMMAND | qma <CONFIG_PATH>

Installation

You need either cargo to install qma.

Using cargo

cargo install qma

Using homebrew (only for OSX)

Config file details.

// global setting
order_by: count
order_desc: asc //
// index = group key settings
index:
    name: method  // Column name on output table.
    accessor: httpRequest.requestMethod  // Json accessor

// fields: Columns list. See `Field setting details` section for details.
fields:
  - name: latency  // Column table on output table.
    accessor: httpRequest.latency.  // Json accessor for target data.
    dtype: second  // data type.
    operation: average // Aggregation method.
  - name: method
    accessor: httpRequest.requestMethod
    dtype: string
    operation: count

[1] Field setting details.

name: The field name to be displayed in the output table. accessor:

Dependencies

~2.7–4MB
~74K SLoC