targetExpr returns a human-readable selector string that describes where this Static will write its value in the event.
()
| 99 | // targetExpr returns a human-readable selector string that describes |
| 100 | // where this Static will write its value in the event. |
| 101 | func (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 | |
| 118 | func (rs *RuntimeStatic) Apply(event *pipeline.Event, enrichFunctions EnricherCtx, logger *log.Entry, debug bool) error { |
| 119 | // we have a few cases : |
no outgoing calls
no test coverage detected