To install cli, simply run:
$ go get github.com/ovh/ldp-tail
ldp-tail --address <URI>
ldp-tail --address wss://gra1.logs.ovh.com/tail/?tk=demo --pattern "{{ .short_message }}"
- Server
address
URI of the websocket
- Filtering
match
Display only messages matching the condition. Example:_method=verifyPassword
. You may specify an operator like:_method.begin=verify
or negate its meaning like:_method.not.begin=verify
. Available operators are:present
The field is presentbegin
The field begins with the valuecontain
The field contains the valuelt
The field is less than the valuele
The field is less than or equal to the valueeq
The field is equal to the valuege
The field is greater than or equal to the valuegt
The field is greater than the value
- Formatting
raw
Display raw message instead of parsing itpattern
Template to apply on each message to display it. Default:{{._appID}}> {{.short_message}}
. Custom available functions are:color
Set text color. Available colors are:green
white
yellow
red
blue
magenta
cyan
bColor
Set background color. Available colors are:green
white
yellow
red
blue
magenta
cyan
noColor
Disable text and background colordate
Transform a timestamp in a human readable date. Default format is2006-01-02 15:04:05
but can be customized with the second optional argumentjoin
Concatenates strings passed in argument with the first argument used as separatorconcat
Concatenates strings passed in argumentduration
Transform a value in a human readable duration. First argument must be a parsable number. The second argument is the multiplier coefficient to be applied based on nanoseconds. Ex: 1000000 if the value is in milliseconds.int
Converts a string in int64float
Converts a string in float64get
Return the value under the key passed in the second argument of the map passed first argument. Useful for accessing keys containing a period. Ex:{{ get . "foo.bar" }}
column
Formats input into multiple columns. Columns are delimited with the characters supplied in the first argument. Ex:"{{ column " | " (date .timestamp) (concat ._method " " ._path ) ._httpStatus_int }}
begin
Return true if the first argument begins with the secondcontain
Return true if the second argument is within the first
- Config
config
Config file loaded before parsing parameters, so parameters will override the values in the config file (except formatch
where parameters will add more criteria instead of replacing them). The config file use the TOML file format. The structure of the configuration file is:
Address string
Match []{
Key string
Operator string
Value interface{}
Not bool
}
Pattern string
Raw bool
Exemple:
Address = "wss://gra1.logs.ovh.com/tail/?tk=demo"
Pattern = "{{date .timestamp}}: {{if ne ._title \"\"}}[ {{._title}} ] {{end}}{{ .short_message }}"
You've developed a new cool feature? Fixed an annoying bug? We'd be happy to hear from you! Make sure to read CONTRIBUTING.md before.
This work is under the BSD license, see the LICENSE file for details.