The first thing users should do is download the current
commandline tool. It can provide access to logs, send data from files in, and assist with setting up log sources.
At present, there are 3 versions of the tool for popular platforms. If we’re missing your platform, please let us know so we can correct the issue: info@current.sh.
There are 2 ways to get the current.sh CLI tool:
- Download it from equinox.io
- Use
current update
from within your existing version. (Some users may have an older version withoutupdate
. Please download a new one from equinox.io).
Login
current login
will log you into current.sh using your Github credentials. This works by using a temporary token so that all your credentials stay on your machine and are never shared with current.sh.
Streams
current streams
provides a listing of all the streams that you have access to.
Default
current default
sets a default stream to be used when one isn’t specified but required with other commands such as search
.
Heroku
current heroku
assists in configuring a heroku app to send its logs to current.sh. More information is available in the Heroku docs section.
Search
current search
allows you to search and view your logs. For example: current search -n widgets
will show the latest logs for the widgets
stream.
Send
current send
can be used to log new data into an stream. There are various options to make this option fairly flexible:
-n <stream name>
: This will cause the data to be sent to the named stream. This option requirescurrent
to be logged in so it can query the user’s streams.-t <token>
: This will have the data sent to the stream associated with the given token. Tokens are consider shared secrets and thusly do not requirecurrent
to be logged in. Tokens for streams can be viewed withcurrent streams
.-u <url>
: This will override all other decisions about how and where to send the data and instead post the data to url as LogShuttle formatted data.- Either
-n
,-t
, or-u
must be specified -s <name>
: This gives a name to the current usage of current so it can use that name to store any file offset data. The idea is to use the same name for the same files, allowing current to track the offset information in its data directory.--db <path>
: This gives an explicit path to use to store the file offset database.- If neither
-s
nor--db
are specified, a session is calculated given the files being watched. --tag key:val
: This allows you to apply a tag to every log entry sent and can be specified multiple times to create multiple tags. A common usage of this is to tag the environment of logs, for instancecurrent send --tag environment:production logs/production.log
.
Inputs
There are 2 ways that send
can get data:
- From standard input. If no arguments are passed,
send
will read standard input one line at a time as log entries. This allows you to pipe data tosend
easily and integrate it with more exotic setups. - From a series of files. Any arguments passed to send that aren’t options are interpreted as paths to files. Send will read files one line at a time as log entries and send them up. This is where the
--db
and-s
options come into play.send
automatically tracks how much data it’s read out of each file so if it’s restarted it doesn’t send data that has already been read.
Setup Docker
current setup-docker
is used to configure a docker installation to send logs to current.sh.
By default, it simply prints out the command to configure docker. If -e
is passed, it will run the commands as well.
This works by running an image called current/autologs
that gathers up the logs from all other containers and ships them up to current.sh.
Containers can opt-out of shipping their logs by setting any of the following:
- A label of
logging.ignore=true
- An environment variable
LOGGING=ignore
- An environment variable
LOGSPOUT=ignore
The last one there is allowed for users that are already using logpsout.