MCPcopy
hub / github.com/crowdsecurity/crowdsec / targetExpr

Method targetExpr

pkg/parser/runtime.go:101–116  ·  view source on GitHub ↗

targetExpr returns a human-readable selector string that describes where this Static will write its value in the event.

()

Source from the content-addressed store, hash-verified

99// targetExpr returns a human-readable selector string that describes
100// where this Static will write its value in the event.
101func (s *Static) targetExpr() string {
102 switch {
103 case s.Method != "":
104 return s.Method
105 case s.Parsed != "":
106 return fmt.Sprintf(".Parsed[%s]", s.Parsed)
107 case s.Meta != "":
108 return fmt.Sprintf(".Meta[%s]", s.Meta)
109 case s.Enriched != "":
110 return fmt.Sprintf(".Enriched[%s]", s.Enriched)
111 case s.TargetByName != "":
112 return s.TargetByName
113 default:
114 return "?"
115 }
116}
117
118func (rs *RuntimeStatic) Apply(event *pipeline.Event, enrichFunctions EnricherCtx, logger *log.Entry, debug bool) error {
119 // we have a few cases :

Callers 3

ApplyMethod · 0.80
ProcessStaticsMethod · 0.80
ProcessStaticsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected