LogDog's logdog
tool is a command-line LogDog Coordinator client.
The logdog
tool supports several subcommands. To see a list, run logdog
without any additional flags.
The auth-login
subcommand can be used to obtain authentication credentials. After running auth-login
successfully, subsequent accesses with the tool will use the cached authentication credentials.
You can log out using the auth-logout
subcommand, or check your authentication status with auth-info
.
The cat
subcommand allows a log stream to be viewed. If the log stream is still streaming, logdog
will block, showing new stream data as it becomes available.
$ logdog -project <project> cat <prefix>/+/<name>
The project may also be integrated into the log stream path. For example, the previous command is equivalent to:
$ logdog cat <project>/<prefix>/+/<name>
The query
subcommand allows queries to be executed against a Coordinator instance.
$ logdog query <params>...
The -json
parameter can be supplied to cause the query to produce detailed JSON output.
Several types of query constraints are supported. Note that these constraints are a subset of LogDog's full query API; consequently, support for additional query constraints may be added in the future.
Paths are of the form “full/path/prefix/+/stream/name”, where the “stream/name” portion can contain glob-style “*” and “**” operators with the following rules:
-path 'foo/bar'
will return all log streams that have the prefix, “foo/bar”.-path 'foo/+/*/baz'
.**
will match all log streams that begin with a specified path.-path 'foo/+/bar/**'
**
will match all log streams that end with a specified path.-path 'foo/+/**/baz'
Queries can be limited by timestamp using the -before
and -after
flags. Timestamps are expressed as RFC 3339 time strings.
For example:
$ logdog query -after '1985-04-12T23:20:50.52Z'
Queries can be restricted to streams that match supplied tags using one or more -tag
constraints.
Tags are specified in one of two forms:
-tag <key>
matches all streams that have the “” tag, regardless of its value.-tag <key>=<value>
matches all streams that have a “” tag with thed value, “”.The ls
subcommand allows the user to navigate the log stream space as if it were a hierarchial directory structure.
To view project-level streams:
$ logdog ls myproject $ logdog ls myproject foo bar $ logdog ls myproject/foo + $ logdog ls myproject/foo/+ baz $ logdog ls myproject/foo/+/baz
The -l
flag may be supplied to cause metadata about each hierarchy component to be printed.