@@ -25,6 +25,11 @@ type ObservabilityPipelineConfig struct {
2525 Processors []ObservabilityPipelineConfigProcessorGroup `json:"processors,omitempty"`
2626 // A list of configured data sources for the pipeline.
2727 Sources []ObservabilityPipelineConfigSourceItem `json:"sources"`
28+ // Set to `true` to continue using the legacy search syntax while migrating filter queries. After migrating all queries to the new syntax, set to `false`.
29+ // The legacy syntax is deprecated and will eventually be removed.
30+ // Requires Observability Pipelines Worker 2.11 or later.
31+ // See [Upgrade Your Filter Queries to the New Search Syntax](https://docs.datadoghq.com/observability_pipelines/guide/upgrade_your_filter_queries_to_the_new_search_syntax/) for more information.
32+ UseLegacySearchSyntax * bool `json:"use_legacy_search_syntax,omitempty"`
2833 // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2934 UnparsedObject map [string ]interface {} `json:"-"`
3035 AdditionalProperties map [string ]interface {} `json:"-"`
@@ -186,6 +191,34 @@ func (o *ObservabilityPipelineConfig) SetSources(v []ObservabilityPipelineConfig
186191 o .Sources = v
187192}
188193
194+ // GetUseLegacySearchSyntax returns the UseLegacySearchSyntax field value if set, zero value otherwise.
195+ func (o * ObservabilityPipelineConfig ) GetUseLegacySearchSyntax () bool {
196+ if o == nil || o .UseLegacySearchSyntax == nil {
197+ var ret bool
198+ return ret
199+ }
200+ return * o .UseLegacySearchSyntax
201+ }
202+
203+ // GetUseLegacySearchSyntaxOk returns a tuple with the UseLegacySearchSyntax field value if set, nil otherwise
204+ // and a boolean to check if the value has been set.
205+ func (o * ObservabilityPipelineConfig ) GetUseLegacySearchSyntaxOk () (* bool , bool ) {
206+ if o == nil || o .UseLegacySearchSyntax == nil {
207+ return nil , false
208+ }
209+ return o .UseLegacySearchSyntax , true
210+ }
211+
212+ // HasUseLegacySearchSyntax returns a boolean if a field has been set.
213+ func (o * ObservabilityPipelineConfig ) HasUseLegacySearchSyntax () bool {
214+ return o != nil && o .UseLegacySearchSyntax != nil
215+ }
216+
217+ // SetUseLegacySearchSyntax gets a reference to the given bool and assigns it to the UseLegacySearchSyntax field.
218+ func (o * ObservabilityPipelineConfig ) SetUseLegacySearchSyntax (v bool ) {
219+ o .UseLegacySearchSyntax = & v
220+ }
221+
189222// MarshalJSON serializes the struct using spec logic.
190223func (o ObservabilityPipelineConfig ) MarshalJSON () ([]byte , error ) {
191224 toSerialize := map [string ]interface {}{}
@@ -203,6 +236,9 @@ func (o ObservabilityPipelineConfig) MarshalJSON() ([]byte, error) {
203236 toSerialize ["processors" ] = o .Processors
204237 }
205238 toSerialize ["sources" ] = o .Sources
239+ if o .UseLegacySearchSyntax != nil {
240+ toSerialize ["use_legacy_search_syntax" ] = o .UseLegacySearchSyntax
241+ }
206242
207243 for key , value := range o .AdditionalProperties {
208244 toSerialize [key ] = value
@@ -213,11 +249,12 @@ func (o ObservabilityPipelineConfig) MarshalJSON() ([]byte, error) {
213249// UnmarshalJSON deserializes the given payload.
214250func (o * ObservabilityPipelineConfig ) UnmarshalJSON (bytes []byte ) (err error ) {
215251 all := struct {
216- Destinations * []ObservabilityPipelineConfigDestinationItem `json:"destinations"`
217- PipelineType * ObservabilityPipelineConfigPipelineType `json:"pipeline_type,omitempty"`
218- ProcessorGroups []ObservabilityPipelineConfigProcessorGroup `json:"processor_groups,omitempty"`
219- Processors []ObservabilityPipelineConfigProcessorGroup `json:"processors,omitempty"`
220- Sources * []ObservabilityPipelineConfigSourceItem `json:"sources"`
252+ Destinations * []ObservabilityPipelineConfigDestinationItem `json:"destinations"`
253+ PipelineType * ObservabilityPipelineConfigPipelineType `json:"pipeline_type,omitempty"`
254+ ProcessorGroups []ObservabilityPipelineConfigProcessorGroup `json:"processor_groups,omitempty"`
255+ Processors []ObservabilityPipelineConfigProcessorGroup `json:"processors,omitempty"`
256+ Sources * []ObservabilityPipelineConfigSourceItem `json:"sources"`
257+ UseLegacySearchSyntax * bool `json:"use_legacy_search_syntax,omitempty"`
221258 }{}
222259 if err = datadog .Unmarshal (bytes , & all ); err != nil {
223260 return datadog .Unmarshal (bytes , & o .UnparsedObject )
@@ -230,7 +267,7 @@ func (o *ObservabilityPipelineConfig) UnmarshalJSON(bytes []byte) (err error) {
230267 }
231268 additionalProperties := make (map [string ]interface {})
232269 if err = datadog .Unmarshal (bytes , & additionalProperties ); err == nil {
233- datadog .DeleteKeys (additionalProperties , & []string {"destinations" , "pipeline_type" , "processor_groups" , "processors" , "sources" })
270+ datadog .DeleteKeys (additionalProperties , & []string {"destinations" , "pipeline_type" , "processor_groups" , "processors" , "sources" , "use_legacy_search_syntax" })
234271 } else {
235272 return err
236273 }
@@ -245,6 +282,7 @@ func (o *ObservabilityPipelineConfig) UnmarshalJSON(bytes []byte) (err error) {
245282 o .ProcessorGroups = all .ProcessorGroups
246283 o .Processors = all .Processors
247284 o .Sources = * all .Sources
285+ o .UseLegacySearchSyntax = all .UseLegacySearchSyntax
248286
249287 if len (additionalProperties ) > 0 {
250288 o .AdditionalProperties = additionalProperties
0 commit comments