Documentation
¶
Overview ¶
Package victorialogs implements providers.LogsProvider against VictoriaLogs, querying with LogsQL and normalizing the NDJSON response into log lines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client queries a VictoriaLogs backend.
func NewWithAuth ¶ added in v0.3.0
NewWithAuth builds a client that adds optional auth to every request. tokenEnv names an env var holding a bearer token (empty, or pointing at an unset/empty var, ⇒ no Authorization header); headers are static request headers (e.g. "X-Scope-OrgID" for a multi-tenant backend). The token is read from the environment at request-build time and is never logged.
func (*Client) Query ¶
func (c *Client) Query(ctx context.Context, query string, w providers.TimeWindow) (providers.LogResult, error)
Query runs a LogsQL query over the window and returns normalized log lines.
It pages with limit+offset up to maxLines so a high-volume window is not silently capped at a single page; when the cap binds (the page that reaches it was full, implying more matched), a sentinel line signals the partial view.
Offset pagination orders by the largest _time values; concurrent ingestion into the queried range could shift the page boundary, but incidents query a settled past window, so this is acceptable for v1.