logrule

package
v0.0.0-...-c91c74a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package logrule log rule

Package logrule log rule

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoCleanLogRule

func AutoCleanLogRule()

AutoCleanLogRule 自动删除已生成新规则的 bcslogconfigs,当新规则创建时间 > 30天并且新规则已产生日志数据,则执行自动清除操作。

func CreateLogRule

func CreateLogRule(c *rest.Context) (interface{}, error)

CreateLogRule 创建日志采集规则 @Summary 创建日志采集规则 @Tags LogCollectors @Produce json @Success 200 @Router /log_collector/rules [post]

func DeleteLogRule

func DeleteLogRule(c *rest.Context) (interface{}, error)

DeleteLogRule 删除日志采集规则 @Summary 删除日志采集规则 @Tags LogCollectors @Produce json @Success 200 @Router /log_collector/rules/:id [delete]

func DisableLogRule

func DisableLogRule(c *rest.Context) (interface{}, error)

DisableLogRule 停用日志采集规则 @Summary 停用日志采集规则 @Tags LogCollectors @Produce json @Success 200 @Router /log_collector/rules/:id/disable [post]

func EnableLogRule

func EnableLogRule(c *rest.Context) (interface{}, error)

EnableLogRule 启用日志采集规则 @Summary 启用日志采集规则 @Tags LogCollectors @Produce json @Success 200 @Router /log_collector/rules/:id/enable [post]

func GetEntrypoints

func GetEntrypoints(c *rest.Context) (interface{}, error)

GetEntrypoints 获取容器日志查询入口 @Summary 获取容器日志查询入口 @Tags LogCollectors @Produce json @Success 200 {object} map[string]Entrypoint @Router /log_collector/entrypoints [post]

func GetLogRule

func GetLogRule(c *rest.Context) (interface{}, error)

GetLogRule 获取日志采集规则详情 @Summary 获取日志采集规则详情 @Tags LogCollectors @Produce json @Success 200 object GetLogRuleResp @Router /log_collector/rules/:id [get]

func GetSpaceID

func GetSpaceID(projectCode string) string

GetSpaceID get space id

func GetStorageClusters

func GetStorageClusters(c *rest.Context) (interface{}, error)

GetStorageClusters 获取 ES 存储集群 @Summary 获取 ES 存储集群 @Tags LogCollectors @Produce json @Success 200 @Router /log_collector/storages/cluster_groups [get]

func ListLogCollectors

func ListLogCollectors(c *rest.Context) (interface{}, error)

ListLogCollectors 获取日志采集规则列表 @Summary 获取日志采集规则列表 @Tags LogCollectors @Produce json @Success 200 {array} GetLogRuleResp @Router /log_collector/rules [get]

func RetryLogRule

func RetryLogRule(c *rest.Context) (interface{}, error)

RetryLogRule 重试日志采集规则 @Summary 重试日志采集规则 @Tags LogCollectors @Produce json @Success 200 @Router /log_collector/rules/:id/retry [post]

func SwitchStorage

func SwitchStorage(c *rest.Context) (interface{}, error)

SwitchStorage 切换 ES 存储集群 @Summary 切换 ES 存储集群 @Tags LogCollectors @Produce json @Success 200 @Router /log_collector/storages/switch_storage [post]

func UpdateLogRule

func UpdateLogRule(c *rest.Context) (interface{}, error)

UpdateLogRule 更新日志采集规则 @Summary 更新日志采集规则 @Tags LogCollectors @Produce json @Success 200 @Router /log_collector/rules/:id [put]

Types

type CreateLogRuleReq

type CreateLogRuleReq struct {
	DisplayName string        `json:"display_name" form:"display_name"`
	Name        string        `json:"name" form:"name" binding:"required" validate:"max=30,min=5,regexp=^[A-Za-z0-9_]+$"`
	RuleName    string        `json:"-" form:"-"`
	Description string        `json:"description"`
	Rule        bklog.LogRule `json:"rule"`
	FromRule    string        `json:"from_rule"`
}

CreateLogRuleReq req

type Entrypoint

type Entrypoint struct {
	STDLogURL     string `json:"std_log_url"`
	FileLogURL    string `json:"file_log_url"`
	STDBKBaseURL  string `json:"std_bk_base_url"`  // 跳转到数据平台地址
	FileBKBaseURL string `json:"file_bk_base_url"` // 跳转到数据平台地址
}

Entrypoint entrypoint

type GetEntrypointsReq

type GetEntrypointsReq struct {
	ContainerIDs []string `json:"container_ids" form:"container_ids"`
}

GetEntrypointsReq params

type GetLogRuleResp

type GetLogRuleResp struct {
	ID                 string         `json:"id"`
	DisplayName        string         `json:"display_name"`
	Name               string         `json:"name"`
	RuleID             int            `json:"rule_id"`
	RuleName           string         `json:"rule_name"`
	Description        string         `json:"description"`
	FileIndexSetID     int            `json:"file_index_set_id"`
	STDIndexSetID      int            `json:"std_index_set_id"`
	RuleFileIndexSetID int            `json:"rule_file_index_set_id"`
	RuleSTDIndexSetID  int            `json:"rule_std_index_set_id"`
	Config             bklog.LogRule  `json:"rule"`
	CreatedAt          utils.JSONTime `json:"created_at"`
	UpdatedAt          utils.JSONTime `json:"updated_at"`
	Creator            string         `json:"creator"`
	Updator            string         `json:"updator"`
	Old                bool           `json:"old"`
	NewRuleID          string         `json:"new_rule_id"` // 当旧规则转换过新规则后,显示该字段
	Entrypoint         Entrypoint     `json:"entrypoint"`
	Status             string         `json:"status"`
	Message            string         `json:"message"`
}

GetLogRuleResp log rule resp

type GetLogRuleRespSortByName

type GetLogRuleRespSortByName []*GetLogRuleResp

GetLogRuleRespSortByName sort LogRule by name

func (GetLogRuleRespSortByName) Len

func (l GetLogRuleRespSortByName) Len() int

Len xxx

func (GetLogRuleRespSortByName) Less

func (l GetLogRuleRespSortByName) Less(i, j int) bool

Less xxx

func (GetLogRuleRespSortByName) Swap

func (l GetLogRuleRespSortByName) Swap(i, j int)

Swap xxx

type GetLogRuleRespSortByStatus

type GetLogRuleRespSortByStatus []*GetLogRuleResp

GetLogRuleRespSortByStatus sort LogRule by status

func (GetLogRuleRespSortByStatus) Len

Len xxx

func (GetLogRuleRespSortByStatus) Less

func (l GetLogRuleRespSortByStatus) Less(i, j int) bool

Less xxx

func (GetLogRuleRespSortByStatus) Swap

func (l GetLogRuleRespSortByStatus) Swap(i, j int)

Swap xxx

type GetLogRuleRespSortByUpdateTime

type GetLogRuleRespSortByUpdateTime []*GetLogRuleResp

GetLogRuleRespSortByUpdateTime sort LogRule by update time

func (GetLogRuleRespSortByUpdateTime) Len

Len xxx

func (GetLogRuleRespSortByUpdateTime) Less

Less xxx

func (GetLogRuleRespSortByUpdateTime) Swap

func (l GetLogRuleRespSortByUpdateTime) Swap(i, j int)

Swap xxx

type SwitchStorageReq

type SwitchStorageReq struct {
	StorageClusterID int `json:"storage_cluster_id"`
}

SwitchStorageReq 切换 ES 存储集群请求

type UpdateLogRuleReq

type UpdateLogRuleReq struct {
	DisplayName string        `json:"display_name" form:"display_name"`
	Description string        `json:"description"`
	Rule        bklog.LogRule `json:"rule"`
}

UpdateLogRuleReq req

Jump to

Keyboard shortcuts

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