![]() ![]() Parse the object as json and output pretty-print colorized json Parse the object as json and output colorized json Parse string as JSON and concatenate the given keys.Īttempt to parse string as JSON and concatenate the given keys. PodColor provided)Īttempt to parse string as JSON, return nil on failure Wrap the text in color (.ContainerColor and. Marshal the object and output it as a json text The following functions are available within the template (besides the builtin The node name where the pod is scheduled on Will receive the following struct: property It accepts a custom template through the -template flag, which will beĬompiled to a Go template and then used for every log message. Only outputs the log message itself, useful when your logs are json and you want to pipe them to jq Templates which you can use by specifying the -output flag: outputĭisplays the namespace, pod and container, and decorates it with color depending on -color Stern supports outputting custom log messages. You can change the config file path with -config flag or STERNCONFIG environment variable. # : tail: 10 max-log-requests: 999 timestamps: short The default config file path is ~/.config/stern/config.yaml. You can use the config file to change the default values of stern options. ![]() If both theĮnvironment variable and -kubeconfig flag are passed the cli flag will be ![]() Stern will use the $KUBECONFIG environment variable if set. ![]() If specified but without value, 'default' is used. Print timestamps with the specified format. Path to template to use for log lines, leave empty to use -output flag. Template to use for log lines, leave empty to use -output flag. The number of lines from the end of the logs to show. Return logs newer than a relative duration like 5s, 2m, or 3h. If present, default to ".*" for the pod-query. Toggle interactive prompt for selecting '/instance' label values. To specify multiple namespaces, repeat this or set comma-separated value. Default to namespace configured in kubernetes context. Defaults to 50, but 5 when specifying -no-follow Maximum number of concurrent logs to request. Path to the kubeconfig file to use for CLI requests. (regular expression)Ĭontainer name to exclude when multiple containers in pod. The name of the kubeconfig context to use To specify multiple states, repeat this or set comma-separated value. Tail containers with state in running, waiting, terminated, or all. Can be 'bash', 'zsh' or 'fish'.Ĭontainer name when multiple containers in pod. Output stern command-line completion code for the specified shell. 'auto': colorize if tty attached, 'always': always colorize, 'never': never colorize. A specific namespace is ignored even if specified with -namespace.įorce set color output. Supported Kubernetes resources are pod, replicationcontroller, service, daemonset, deployment, To the specified Kubernetes resource, such as deployment/nginx. When the query is in the form / (exact match), you can select all pods belonging So you could provide "web-\w" to tail web-backend and web-frontend pods but not web-123. The query is a regular expression when it is not a Kubernetes resource, The pod-query is a regular expression or a Kubernetes resource in the form /. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |