Documentation
¶
Overview ¶
Package logsql builds VictoriaLogs LogsQL queries. Values enter only through its functions, quoted (and turned into escaped regular expressions where a pattern is needed); field names are the caller's constants, checked and quoted too. There is no raw LogsQL input.
Index ¶
- type Field
- type Filter
- type Order
- type Query
- func (q Query) CountByTime(timeField Field, step time.Duration, hits Field) Query
- func (q Query) Fields(fields ...Field) Query
- func (q Query) Hash(as Field) Query
- func (q Query) LastBy(by, partition Field) Query
- func (q Query) Sort(limit int, keys ...Order) Query
- func (q Query) Stats(key Field, stats ...Stat) Query
- func (q Query) String() string
- func (q Query) Sum(a, b, alias Field) Query
- func (q Query) Where(f Filter) Query
- type Stat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field string
Field is a stored field name.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is a LogsQL filter expression.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is a filter followed by pipes.
func (Query) CountByTime ¶
CountByTime counts rows per step of time as hits.
type Stat ¶
type Stat struct {
// contains filtered or unexported fields
}
Stat is one aggregate of Stats.
func CountUniqIf ¶
CountUniqIf counts distinct values of field among rows matching if.
Click to show internal directories.
Click to hide internal directories.