opensearch

package
v1.0.1201 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFieldMappingConfig = logs.FieldMappingConfig{
	Message:   []string{"message"},
	Timestamp: []string{"@timestamp"},
	Severity:  []string{"log"},
}

Functions

func New added in v1.0.953

func New(ctx context.Context, backend Backend, mappingConfig *logs.FieldMappingConfig) (*searcher, error)

Types

type Backend

type Backend struct {
	ConnectionName string        `json:"connection,omitempty"`
	Address        string        `json:"address,omitempty"`
	Username       *types.EnvVar `json:"username,omitempty"`
	Password       *types.EnvVar `json:"password,omitempty"`
}

+kubebuilder:object:generate=true

func (*Backend) DeepCopy

func (in *Backend) DeepCopy() *Backend

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend.

func (*Backend) DeepCopyInto

func (in *Backend) DeepCopyInto(out *Backend)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HitsInfo

type HitsInfo struct {
	Total    TotalHitsInfo `json:"total"`
	MaxScore float64       `json:"max_score"`
	Hits     []SearchHit   `json:"hits"`
}

func (*HitsInfo) NextPage

func (t *HitsInfo) NextPage(requestedRowsCount int) string

NextPage returns the next page token.

type Request

type Request struct {
	Index string `json:"index" template:"true"`
	Query string `json:"query" template:"true"`
	Limit string `json:"limit,omitempty" template:"true"`
}

+kubebuilder:object:generate=true

func (*Request) DeepCopy

func (in *Request) DeepCopy() *Request

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Request.

func (*Request) DeepCopyInto

func (in *Request) DeepCopyInto(out *Request)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Response added in v1.0.953

type Response struct {
	Took     float64  `json:"took"`
	TimedOut bool     `json:"timed_out"`
	Hits     HitsInfo `json:"hits"`
}

type Result

type Result struct {
	// Id is the unique identifier provided by the underlying system, use to link to a point in time of a log stream
	Id string `json:"id,omitempty"`
	// RFC3339 timestamp
	Time    string            `json:"timestamp,omitempty"`
	Message string            `json:"message,omitempty"`
	Labels  map[string]string `json:"labels,omitempty"`
}

type SearchHit

type SearchHit struct {
	Index  string         `json:"_index"`
	Type   string         `json:"_type"`
	ID     string         `json:"_id"`
	Score  float64        `json:"_score"`
	Sort   []any          `json:"sort"`
	Source map[string]any `json:"_source"`
}

type SearchResults

type SearchResults struct {
	Total    int64            `json:"total,omitempty"`
	Results  []map[string]any `json:"results,omitempty"`
	NextPage string           `json:"nextPage,omitempty"`
}

type TotalHitsInfo

type TotalHitsInfo struct {
	Value    int64  `json:"value"`
	Relation string `json:"relation"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL