azurelogs

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogQueryClients map[string]*azquery.LogsClient

LogQueryClients holds the Azure Logs clients for different subscriptions This is a global variable to avoid creating a new client for each query

Functions

func CreateLogsClient

func CreateLogsClient(sess *Session, subscriptionID string) (*azquery.LogsClient, error)

CreateLogsClient creates a cached Azure Log Analytics client for the specified subscription

func InitializeAzureAuthentication

func InitializeAzureAuthentication(sess *Session) error

InitializeAzureAuthentication sets up Azure authentication using modern SDK

Types

type AZClientSecretCredential

type AZClientSecretCredential struct {
	ClientID     string
	ClientSecret string
	TenantID     string
}

AZClientSecretCredential holds Azure service principal credentials

type AZSession

type AZSession struct {
	Credential             azcore.TokenCredential
	ClientSecretCredential AZClientSecretCredential
}

AZSession holds Azure authentication and client information

type QueryFile

type QueryFile struct {
	Title          string   `yaml:"title"`                 // Display title for the query
	SubscriptionID string   `yaml:"azure_subscription_id"` // Azure subscription ID
	WorkspaceID    string   `yaml:"azure_workspace_id"`    // Log Analytics workspace ID
	Columns        []string `yaml:"columns"`               // Expected column names
	Query          string   `yaml:"query"`                 // KQL query string
}

QueryFile represents the structure of a query configuration file

type Session

type Session struct {
	App struct {
		SemVer string
	}

	Azure       *AZSession
	QueriesPath string
	QueryFile   QueryFile
}

Session holds the configuration and state for an Azure Log Analytics session

func Init

func Init(queryPath *string) (*Session, error)

Init initializes a new Azure session with the specified query file

type Settings

type Settings struct {
	*cfg.Common

	// Queryfile is the path to the YAML file containing the Azure query configuration
	Queryfile string `help:"Path to YAML file containing Azure Log Analytics query configuration"`
}

Settings defines the configuration for the Azure Logs widget

func NewSettingsFromYAML

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings

NewSettingsFromYAML creates a new Settings instance from YAML configuration

type TableResp

type TableResp struct {
	Header []string   // Column headers
	Rows   []TableRow // Data rows
}

TableResp represents the response from an Azure Log Analytics query

func RunQuery

func RunQuery(sess *Session) (*TableResp, error)

RunQuery executes an Azure Log Analytics query and returns the formatted results

type TableRow

type TableRow []string

TableRow represents a single row of data from Azure Log Analytics

type Widget

type Widget struct {
	view.TextWidget
	// contains filtered or unexported fields
}

func NewWidget

func NewWidget(tviewApp *tview.Application, redrawChan chan bool, _ *tview.Pages, settings *Settings) *Widget

NewWidget creates a new instance of a widget

func (*Widget) Refresh

func (widget *Widget) Refresh()

Jump to

Keyboard shortcuts

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