Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/splunk/client/enterprise.go
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,7 @@ func (c *SplunkClient) UpdateConfFile(ctx context.Context, logger *slog.Logger,
return err
}

logger.InfoContext(ctx, "Validating conf file object creation", "fileName", fileName, "property", property)
expectedStatus := []int{200, 201, 409}
err = c.Do(request, expectedStatus, nil)
if err != nil {
Expand All @@ -1065,13 +1066,14 @@ func (c *SplunkClient) UpdateConfFile(ctx context.Context, logger *slog.Logger,
body = body[:len(body)-1]
}

logger.DebugContext(ctx, "Updating conf file object", "fileName", fileName, "property", property)
logger.InfoContext(ctx, "Updating conf file object", "fileName", fileName, "property", property)
request, err = http.NewRequest("POST", endpoint, strings.NewReader(body))
if err != nil {
logger.ErrorContext(ctx, "Failed to update conf file object", "fileName", fileName, "property", property, "error", err.Error())
return err
}

logger.InfoContext(ctx, "Validating conf file object update", "fileName", fileName, "property", property)
expectedStatus = []int{200, 201}
err = c.Do(request, expectedStatus, nil)
if err != nil {
Expand Down
Loading
Loading