Simple cli tool to aggeregate structured log.
Before execute qma
command, prepare the yaml file which describe table you want to output. See "config file details" section for detail.
Execute qma
command. You can use either stdin or file for input.
qma <CONFIG_PATH> <LOG_FILE_PATH>
SOME COMMAND | qma <CONFIG_PATH>
You need either cargo to install qma.
Using cargo
cargo install qma
Using homebrew (only for OSX)
brew tap toritoritori29/tools
brew install qma
# global setting
order_by: count # (optional). Specify the field name you want to order by.
order: asc # (optional). Specify order you want to sort.
# index = grouping 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
index
Grouping key settings. See the 'index' section for detail.fields
Field list to display. See the `field section for detail.order_by
(optional) The field name you want to order by.order
(optional) Order you want to sort.output_format
(optional) Table style you want show.csv
ormarkdown
. Default iscsv
.
name
The field name to be displayed in the output table.accessor
Accessor to json property. Join properties with dots like "aaa.bbb.ccc".
name
The field name to be displayed in the output table.accessor
Accessor to json property. Join properties with dots like "aaa.bbb.ccc".dtype
Data type. Choose fromstring
,integer
,float
,seconds
. If you specfiyseconds
, the target data must be numeric data which have 's' or 'sec' as a suffix.operation
Aggregation method. See 'Aggregation methods' section for detail.
method | description | available dtype |
---|---|---|
average | Average field | integer, float, seconds |
count | Count valid data | string, integer, float, seconds |
This project is under the MIT license.