Skip to content

Commit 27a3832

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update Public API for OP Splunk HEC destination indexed_fields (#3823)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 15fdc3e commit 27a3832

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46462,6 +46462,15 @@ components:
4646246462
description: Optional name of the Splunk index where logs are written.
4646346463
example: main
4646446464
type: string
46465+
indexed_fields:
46466+
description: List of log field names to send as indexed fields to Splunk
46467+
HEC. Available only when `encoding` is `json`.
46468+
example:
46469+
- service
46470+
- host
46471+
items:
46472+
type: string
46473+
type: array
4646546474
inputs:
4646646475
description: A list of component IDs whose output is used as the `input`
4646746476
for this component.

api/datadogV2/model_observability_pipeline_splunk_hec_destination.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ type ObservabilityPipelineSplunkHecDestination struct {
2727
Id string `json:"id"`
2828
// Optional name of the Splunk index where logs are written.
2929
Index *string `json:"index,omitempty"`
30+
// List of log field names to send as indexed fields to Splunk HEC. Available only when `encoding` is `json`.
31+
IndexedFields []string `json:"indexed_fields,omitempty"`
3032
// A list of component IDs whose output is used as the `input` for this component.
3133
Inputs []string `json:"inputs"`
3234
// The Splunk sourcetype to assign to log events.
@@ -225,6 +227,34 @@ func (o *ObservabilityPipelineSplunkHecDestination) SetIndex(v string) {
225227
o.Index = &v
226228
}
227229

230+
// GetIndexedFields returns the IndexedFields field value if set, zero value otherwise.
231+
func (o *ObservabilityPipelineSplunkHecDestination) GetIndexedFields() []string {
232+
if o == nil || o.IndexedFields == nil {
233+
var ret []string
234+
return ret
235+
}
236+
return o.IndexedFields
237+
}
238+
239+
// GetIndexedFieldsOk returns a tuple with the IndexedFields field value if set, nil otherwise
240+
// and a boolean to check if the value has been set.
241+
func (o *ObservabilityPipelineSplunkHecDestination) GetIndexedFieldsOk() (*[]string, bool) {
242+
if o == nil || o.IndexedFields == nil {
243+
return nil, false
244+
}
245+
return &o.IndexedFields, true
246+
}
247+
248+
// HasIndexedFields returns a boolean if a field has been set.
249+
func (o *ObservabilityPipelineSplunkHecDestination) HasIndexedFields() bool {
250+
return o != nil && o.IndexedFields != nil
251+
}
252+
253+
// SetIndexedFields gets a reference to the given []string and assigns it to the IndexedFields field.
254+
func (o *ObservabilityPipelineSplunkHecDestination) SetIndexedFields(v []string) {
255+
o.IndexedFields = v
256+
}
257+
228258
// GetInputs returns the Inputs field value.
229259
func (o *ObservabilityPipelineSplunkHecDestination) GetInputs() []string {
230260
if o == nil {
@@ -349,6 +379,9 @@ func (o ObservabilityPipelineSplunkHecDestination) MarshalJSON() ([]byte, error)
349379
if o.Index != nil {
350380
toSerialize["index"] = o.Index
351381
}
382+
if o.IndexedFields != nil {
383+
toSerialize["indexed_fields"] = o.IndexedFields
384+
}
352385
toSerialize["inputs"] = o.Inputs
353386
if o.Sourcetype != nil {
354387
toSerialize["sourcetype"] = o.Sourcetype
@@ -373,6 +406,7 @@ func (o *ObservabilityPipelineSplunkHecDestination) UnmarshalJSON(bytes []byte)
373406
EndpointUrlKey *string `json:"endpoint_url_key,omitempty"`
374407
Id *string `json:"id"`
375408
Index *string `json:"index,omitempty"`
409+
IndexedFields []string `json:"indexed_fields,omitempty"`
376410
Inputs *[]string `json:"inputs"`
377411
Sourcetype *string `json:"sourcetype,omitempty"`
378412
TokenKey *string `json:"token_key,omitempty"`
@@ -392,7 +426,7 @@ func (o *ObservabilityPipelineSplunkHecDestination) UnmarshalJSON(bytes []byte)
392426
}
393427
additionalProperties := make(map[string]interface{})
394428
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
395-
datadog.DeleteKeys(additionalProperties, &[]string{"auto_extract_timestamp", "buffer", "encoding", "endpoint_url_key", "id", "index", "inputs", "sourcetype", "token_key", "type"})
429+
datadog.DeleteKeys(additionalProperties, &[]string{"auto_extract_timestamp", "buffer", "encoding", "endpoint_url_key", "id", "index", "indexed_fields", "inputs", "sourcetype", "token_key", "type"})
396430
} else {
397431
return err
398432
}
@@ -408,6 +442,7 @@ func (o *ObservabilityPipelineSplunkHecDestination) UnmarshalJSON(bytes []byte)
408442
o.EndpointUrlKey = all.EndpointUrlKey
409443
o.Id = *all.Id
410444
o.Index = all.Index
445+
o.IndexedFields = all.IndexedFields
411446
o.Inputs = *all.Inputs
412447
o.Sourcetype = all.Sourcetype
413448
o.TokenKey = all.TokenKey

0 commit comments

Comments
 (0)