Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[d8] Add d8 backup loki option #95

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

[d8] Add d8 backup loki option #95

wants to merge 2 commits into from

Conversation

d2285
Copy link
Member

@d2285 d2285 commented Feb 21, 2025

This pr add d8 backup loki option to dump all logs from Loki api endpoint or in giver range timestamp.
e.g.

d8 backup loki --help
Dump Loki logs.

 This command dump all logs from Loki api or in given range timestamps in DKP.

 © Flant JSC 2025

Usage:
  d8 backup loki [flags]

Flags:
      --end string     Set end timestamp range to dump logs from Loki. (Default get max end timestamp from Loki, ex. "2025-01-14 15:04:05".)
  -h, --help           help for loki
      --limit string   Limit max string to output per queue from Loki. (Default 100000 max limit strings per queue.)
      --start string   Set start timestamp range to dump logs from Loki. (Default get max start timestamp from Loki, ex. "2025-01-12 15:04:05".)

Global Flags:
  -k, --kubeconfig string   KubeConfig of the cluster. (default is $KUBECONFIG when it is set, $HOME/.kube/config otherwise) (default "/root/.kube/config")

@d2285
Copy link
Member Author

d2285 commented Feb 21, 2025

ex. output logs from Loki Api

Timestamp: [2025-02-20 13:30:26.371161215 +0000 UTC], Log: ts=2025-02-20T13:30:26.332Z caller=netdev_common.go:81 level=info collector=netdev msg="Parsed flag --collector.netdev.device-exclude" flag=^(veth.*|lxc.*|[a-f0-9]{15})$

Timestamp: [2025-02-20 13:30:26.371145721 +0000 UTC], Log: ts=2025-02-20T13:30:26.331Z caller=node_exporter.go:194 level=info msg="Build context" build_context="(go=go1.22.6, platform=linux/amd64, user=, date=, tags=unknown)"

Timestamp: [2025-02-20 13:30:26.371130298 +0000 UTC], Log: ts=2025-02-20T13:30:26.331Z caller=node_exporter.go:193 level=info msg="Starting node_exporter" version="(version=, branch=, revision=unknown)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant