find

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Find = &charm.Spec{
	Name:  "find",
	Usage: "find [options] pattern [pattern...]",
	Short: "look through zar index files and displays matches",
	Long: `
TBD: update this help: Issue #2532

"zar find" searches a zar archive
looking for zng files that have been indexed and performs a search on
each such index file in accordance with the specified search pattern.
Indexes are created by "zar index".

For standard indexes, "pattern" argument has the form "field=value" (for field searches)
or ":type=value" (for type searches).  For example, if type "ip" has been
indexed then the IP 10.0.1.2 can be searched by saying

	zar find :ip=10.0.1.2

Or if the field "uri" has been indexed, you might say

	zar find uri=/x/y/z

For custom indexes, the name of index is given by the -x option,
and the "pattern" argument(s) comprise one or more values that
are parseable in accordance with the zng type of the corresponding
search keys.  For example, an index with custom keys of the form

	record[a:record[x:int64,y:ip],b:string]

could be queried using syntax like this

	zar find -x custom 99 10.0.0.1 hello

The results of a search is either a list of the paths of each
zng log that matches the pattern (the default), or a zng stream of the
records of the base layer of the index file (-z)
`,
	New: New,
}

Functions

func New

func New(parent charm.Command, f *flag.FlagSet) (charm.Command, error)

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

func (*Command) Run

func (c *Command) Run(args []string) error

Jump to

Keyboard shortcuts

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