Skip to content

Commit 7c8d63e

Browse files
authored
Fix collector creation error by including all fields in initial create request (#839)
* Fix collector creation error by including all fields in initial create request * Add entry in changelog
1 parent 0675895 commit 7c8d63e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ ENHANCEMENTS:
2020
BUG FIXES:
2121
* Fix for failing content test case for scheduled searches
2222

23+
BUG FIXES:
24+
* Fixed collector creation error by including all fields in initial create request.
25+
2326
## 3.2.2 (January 6, 2026)
2427
DOCS:
2528
* Added searchableTime description for intervalTimeType in create log search parameters

sumologic/resource_sumologic_collector.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,24 @@ func resourceSumologicCollectorCreate(d *schema.ResourceData, meta interface{})
115115
c := meta.(*Client)
116116

117117
if d.Id() == "" {
118-
id, err := c.CreateCollector(Collector{
118+
collector := Collector{
119119
CollectorType: "Hosted",
120120
Name: d.Get("name").(string),
121-
})
121+
Description: d.Get("description").(string),
122+
Category: d.Get("category").(string),
123+
TimeZone: d.Get("timezone").(string),
124+
Fields: d.Get("fields").(map[string]interface{}),
125+
}
122126

127+
id, err := c.CreateCollector(collector)
123128
if err != nil {
124129
return err
125130
}
126131

127132
d.SetId(strconv.FormatInt(id, 10))
128133
}
129134

130-
return resourceSumologicCollectorUpdate(d, meta)
135+
return resourceSumologicCollectorRead(d, meta)
131136
}
132137

133138
func resourceSumologicCollectorUpdate(d *schema.ResourceData, meta interface{}) error {

0 commit comments

Comments
 (0)