@@ -101,6 +101,7 @@ type ParseTermT struct {
101101 Set * ParseSetT `yaml:"set,omitempty"`
102102 Sequence * ParseSequenceT `yaml:"sequence,omitempty"`
103103 NegateOpts * ParseNegateOptsT `yaml:",inline,omitempty"`
104+ PromQL * ParsePromQL `yaml:"promql,omitempty"`
104105 Extract []ParseExtractT `yaml:"extract,omitempty"`
105106}
106107
@@ -118,22 +119,30 @@ type ParseExtractT struct {
118119 RegexValue string `yaml:"regex,omitempty"`
119120}
120121
122+ type ParsePromQL struct {
123+ Expr string `yaml:"expr"`
124+ Interval string `yaml:"interval,omitempty"`
125+ For string `yaml:"for,omitempty"`
126+ Event * ParseEventT `yaml:"event,omitempty"`
127+ }
128+
121129func (o * ParseTermT ) UnmarshalYAML (unmarshal func (any ) error ) error {
122130 var str string
123131 if err := unmarshal (& str ); err == nil {
124132 o .StrValue = str
125133 return nil
126134 }
127135 var temp struct {
128- Field string `yaml:"field,omitempty"`
129- StrValue string `yaml:"value,omitempty"`
130- JqValue string `yaml:"jq,omitempty"`
131- RegexValue string `yaml:"regex,omitempty"`
132- Count int `yaml:"count,omitempty"`
133- Set * ParseSetT `yaml:"set,omitempty"`
134- Sequence * ParseSequenceT `yaml:"sequence,omitempty"`
135- NegateOpts * ParseNegateOptsT `yaml:",inline,omitempty"`
136- Extract []ParseExtractT `yaml:"extract,omitempty"`
136+ Field string `yaml:"field,omitempty"`
137+ StrValue string `yaml:"value,omitempty"`
138+ JqValue string `yaml:"jq,omitempty"`
139+ RegexValue string `yaml:"regex,omitempty"`
140+ Count int `yaml:"count,omitempty"`
141+ Set * ParseSetT `yaml:"set,omitempty"`
142+ Sequence * ParseSequenceT `yaml:"sequence,omitempty"`
143+ NegateOpts * ParseNegateOptsT `yaml:",inline,omitempty"`
144+ ParsePromQL * ParsePromQL `yaml:"promql,omitempty"`
145+ Extract []ParseExtractT `yaml:"extract,omitempty"`
137146 }
138147 if err := unmarshal (& temp ); err != nil {
139148 return err
@@ -146,6 +155,7 @@ func (o *ParseTermT) UnmarshalYAML(unmarshal func(any) error) error {
146155 o .Set = temp .Set
147156 o .Sequence = temp .Sequence
148157 o .NegateOpts = temp .NegateOpts
158+ o .PromQL = temp .ParsePromQL
149159 o .Extract = temp .Extract
150160 return nil
151161}
0 commit comments