Documentation ¶
Index ¶
- Constants
- Variables
- func Extract(input string, splitsStr []string) []string
- func GetSplits(target string) (splitStr []string, matchers []string)
- func IsK8sVar(key string) bool
- func Validate(pattern string) error
- type Pattern
- func (p *Pattern) K8sMatcherRender(key string) string
- func (p *Pattern) Render() (string, error)
- func (p *Pattern) RenderWithStrict() (string, error)
- func (p *Pattern) WithK8sNode(data *TypeNodeFieldsData) *Pattern
- func (p *Pattern) WithK8sPod(data *TypePodFieldsData) *Pattern
- func (p *Pattern) WithObject(obj *runtime.Object) *Pattern
- func (p *Pattern) WithVm(data *TypeVmFieldsData) *Pattern
- type TypeNodeFieldsData
- type TypePodFieldsData
- type TypeVmFieldsData
Constants ¶
View Source
const ( Indicator = '$' SeparatorPrefix = '{' SeparatorSuffix = '}' )
View Source
const (
AllLabelToken = "${labels.key}"
)
Variables ¶
View Source
var ErrEmptyMatcher = errors.New("render matcher is empty")
Functions ¶
func Extract ¶
Extract eg: input="/var/log/76fb94cbb5/tomcat/", splitsStr=["/var/log/", "/", "/"]
return ["76fb94cbb5", "tomcat"]
Types ¶
type Pattern ¶ added in v1.2.0
type Pattern struct { Raw string // contains filtered or unexported fields }
func (*Pattern) K8sMatcherRender ¶ added in v1.3.0
func (*Pattern) RenderWithStrict ¶ added in v1.3.1
RenderWithStrict any placeholder rendering empty will return an error
func (*Pattern) WithK8sNode ¶ added in v1.3.0
func (p *Pattern) WithK8sNode(data *TypeNodeFieldsData) *Pattern
func (*Pattern) WithK8sPod ¶ added in v1.3.0
func (p *Pattern) WithK8sPod(data *TypePodFieldsData) *Pattern
func (*Pattern) WithObject ¶ added in v1.2.0
func (*Pattern) WithVm ¶ added in v1.5.0
func (p *Pattern) WithVm(data *TypeVmFieldsData) *Pattern
type TypeNodeFieldsData ¶ added in v1.3.0
func NewTypeNodeFieldsData ¶ added in v1.3.0
func NewTypeNodeFieldsData(node *corev1.Node, clusterlogconfig string) *TypeNodeFieldsData
type TypePodFieldsData ¶ added in v1.3.0
type TypePodFieldsData struct { Pod *corev1.Pod ContainerName string LogConfig string ClusterLogConfig string }
func NewTypePodFieldsData ¶ added in v1.3.0
func NewTypePodFieldsData(pod *corev1.Pod, containerName string, lgc *logconfigv1beta1.LogConfig) *TypePodFieldsData
type TypeVmFieldsData ¶ added in v1.5.0
func NewTypeVmFieldsData ¶ added in v1.5.0
func NewTypeVmFieldsData(vm *v1beta1.Vm, clusterlogconfig string) *TypeVmFieldsData
Click to show internal directories.
Click to hide internal directories.