mgotools

command module
v0.0.0-...-43c0f45 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

README

mgotools

This tool suite is the spiritual successor to mtools, a series of python libraries designed to quickly parse and summarize MongoDB log files.

MongoDB log files are full of useful information but also complicated to parse through quickly. These tools are designed to easily filter through large files quickly. They're designed to be extendable so other projects can incorporate the binaries.

Usage

There is one binary currently generated. The plan is to build drop-in binary replacements for mloginfo and mlogfilter. Until then, sub-commands are available.

Each tool may take input from stdin or log files.

> cat mongod.log | mgotools query
> mgotools query mongod.log

Additionally, some command line arguments may be passed multiple times to apply to multiple log files. For example, mgotools filter --from 2019-01-01 --from 2018-01-01 mongod1.log mongod2.log

In this example, the first from argument applies to mongod1.log and the second from argument applies to mongod2.log.

filter

./mgotools filter --help

info

./mgotools info --help

queries

./mgotools query --help

The query command aggregates the canonicalized version

connstats

./mgotools connstats --help

restart

./mgotools restart --help

Build

The build process should be straightforward. Running the following commands should work on properly configured Go environments:

> cd $GOPATH/src
> git clone https://github.com/jtv4k/mgotools
> cd mgotools
> go get 
> go build 

A binary named mgotools will be generated that can be executed using ./mgotools.

Documentation

Overview

mgotools.go

The main utility built with this suite of tools. It takes files as command line arguments or stdin and outputs to stdout.

Directories

Path Synopsis
A message helper functions exist because there are a lot of similarities between the different log formats.
A message helper functions exist because there are a lot of similarities between the different log formats.
record
Package util provides general assistance to the parser and other areas of code.
Package util provides general assistance to the parser and other areas of code.

Jump to

Keyboard shortcuts

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