azureloganalytics

package
v0.1.102 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

ABOUTME: Implements log searching against Azure Monitor Log Analytics workspaces. ABOUTME: Executes KQL queries and maps tabular results to canonical LogLine format.

Index

Constants

This section is empty.

Variables

View Source
var DefaultFieldMappingConfig = logs.FieldMappingConfig{
	Timestamp: []string{"TimeGenerated", "Timestamp"},
	Message:   []string{"Message", "RenderedDescription", "ResultDescription"},
	Severity:  []string{"SeverityLevel", "Level", "EventLevelName"},
	Host:      []string{"Computer", "_ResourceId"},
	Source:    []string{"Source", "Category", "OperationName"},
}

DefaultFieldMappingConfig defines sensible defaults for common Azure Monitor log columns.

Functions

This section is empty.

Types

type ClientOptions added in v0.1.92

type ClientOptions struct {
	// Endpoint is the Log Analytics API root including the version, e.g.
	// "https://api.loganalytics.us/v1".
	Endpoint string
	// Scope is the token scope, e.g. "https://api.loganalytics.us/.default".
	Scope string
	// Authority is the Azure AD authority used with the connection's client
	// secret, e.g. "https://login.microsoftonline.us".
	Authority string
}

ClientOptions overrides the public-cloud defaults, for sovereign clouds and stub servers. Zero values select the public cloud.

type Request

type Request struct {
	logs.LogsRequestBase `json:",inline" template:"true"`

	// WorkspaceID is the Azure Log Analytics workspace ID to query.
	WorkspaceID string `json:"workspaceID" template:"true"`

	// Query is the KQL (Kusto Query Language) query to execute.
	Query string `json:"query" template:"true"`
}

Request represents parameters for Azure Log Analytics queries.

+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 Searcher

type Searcher struct {
	// contains filtered or unexported fields
}

Searcher implements log searching using Azure Log Analytics.

func New

func New(conn connection.AzureConnection, mappingConfig *logs.FieldMappingConfig) *Searcher

New creates a new Azure Log Analytics searcher.

func NewWithClientOptions

func NewWithClientOptions(conn connection.AzureConnection, mappingConfig *logs.FieldMappingConfig, clientOptions ClientOptions) *Searcher

NewWithClientOptions creates a searcher whose Log Analytics client uses the caller-supplied endpoint, scope and authority.

func (*Searcher) Search

func (s *Searcher) Search(ctx context.Context, request Request) (*logs.LogResult, error)

Search executes a KQL query against an Azure Log Analytics workspace.

Jump to

Keyboard shortcuts

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