From dad90c0cd2a8ba4555f57e8033f32512ec7bda78 Mon Sep 17 00:00:00 2001 From: zscholl Date: Wed, 9 Dec 2020 20:20:40 -0600 Subject: [PATCH 1/2] add defaults to saved searches fields --- splunk/resource_splunk_saved_searches.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/splunk/resource_splunk_saved_searches.go b/splunk/resource_splunk_saved_searches.go index c4a3725b..39b522ec 100644 --- a/splunk/resource_splunk_saved_searches.go +++ b/splunk/resource_splunk_saved_searches.go @@ -242,7 +242,7 @@ func savedSearches() *schema.Resource { "action_email_track_alert": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Indicates whether the execution of this action signifies a trackable alert.", }, "action_email_ttl": { @@ -269,7 +269,7 @@ func savedSearches() *schema.Resource { "action_email_width_sort_columns": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Indicates whether columns should be sorted from least wide to most wide, left to right." + "Only valid if format=text.", }, @@ -414,7 +414,7 @@ func savedSearches() *schema.Resource { "action_script_track_alert": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Indicates whether the execution of this action signifies a trackable alert.", }, "action_script_ttl": { @@ -455,7 +455,7 @@ func savedSearches() *schema.Resource { "action_summary_index_inline": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Determines whether to execute the summary indexing action as part of the scheduled search." + "NOTE: This option is considered only if the summary index action is enabled and is always executed (in other words, if counttype = always).Defaults to true ", }, @@ -515,7 +515,7 @@ func savedSearches() *schema.Resource { "alert_digest_mode": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Specifies whether alert actions are applied to the entire result set or on each individual result." + "Defaults to 1 (true).", }, @@ -766,7 +766,7 @@ func savedSearches() *schema.Resource { "dispatch_lookups": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Enables or disables the lookups for this search. Defaults to 1. ", }, "dispatch_max_count": { @@ -804,7 +804,7 @@ func savedSearches() *schema.Resource { "dispatch_spawn_process": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Specifies whether a new search process spawns when this saved search is executed. " + "Defaults to 1. Searches against indexes must run in a separate process. ", }, @@ -856,7 +856,7 @@ func savedSearches() *schema.Resource { "realtime_schedule": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Defaults to 1. Controls the way the scheduler computes the next execution time of a scheduled search. " + "If this value is set to 1, the scheduler bases its determination of the next scheduled search execution time on the current time. " + "If this value is set to 0, the scheduler bases its determination of the next scheduled search on the last search execution time. " + @@ -879,7 +879,7 @@ func savedSearches() *schema.Resource { "restart_on_searchpeer_add": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: true, Description: "Specifies whether to restart a real-time search managed by the scheduler when a search peer becomes available for this saved search. " + "Defaults to 1. ", }, From b9585fc4393542b6cc50ff9e1d9e106871b038bc Mon Sep 17 00:00:00 2001 From: zscholl Date: Fri, 5 Feb 2021 13:59:33 -0600 Subject: [PATCH 2/2] add default for view_link results_link and push them if they are 0 --- client/models/saved_searches.go | 10 +++++----- splunk/resource_splunk_saved_searches.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/models/saved_searches.go b/client/models/saved_searches.go index 537068c5..b756df21 100644 --- a/client/models/saved_searches.go +++ b/client/models/saved_searches.go @@ -22,11 +22,11 @@ type SavedSearchObject struct { ActionEmailFormat string `json:"action.email.format,omitempty" url:"action.email.format,omitempty"` ActionEmailFrom string `json:"action.email.from,omitempty" url:"action.email.from,omitempty"` ActionEmailHostname string `json:"action.email.hostname,omitempty" url:"action.email.hostname,omitempty"` - ActionEmailIncludeResultsLink int `json:"action.email.include.results_link,string,omitempty" url:"action.email.include.results_link,omitempty"` - ActionEmailIncludeSearch int `json:"action.email.include.search,string,omitempty" url:"action.email.include.search,omitempty"` - ActionEmailIncludeTrigger int `json:"action.email.include.trigger,string,omitempty" url:"action.email.include.trigger,omitempty"` - ActionEmailIncludeTriggerTime int `json:"action.email.include.trigger_time,string,omitempty" url:"action.email.include.trigger_time,omitempty"` - ActionEmailIncludeViewLink int `json:"action.email.include.view_link,string,omitempty" url:"action.email.include.view_link,omitempty"` + ActionEmailIncludeResultsLink int `json:"action.email.include.results_link,string,omitempty" url:"action.email.include.results_link"` + ActionEmailIncludeSearch int `json:"action.email.include.search,string,omitempty" url:"action.email.include.search"` + ActionEmailIncludeTrigger int `json:"action.email.include.trigger,string,omitempty" url:"action.email.include.trigger"` + ActionEmailIncludeTriggerTime int `json:"action.email.include.trigger_time,string,omitempty" url:"action.email.include.trigger_time"` + ActionEmailIncludeViewLink int `json:"action.email.include.view_link,string,omitempty" url:"action.email.include.view_link"` ActionEmailInline bool `json:"action.email.inline" url:"action.email.inline"` ActionEmailMailserver string `json:"action.email.mailserver,omitempty" url:"action.email.mailserver,omitempty"` ActionEmailMaxResults int `json:"action.email.maxresults,omitempty" url:"action.email.maxresults,omitempty"` diff --git a/splunk/resource_splunk_saved_searches.go b/splunk/resource_splunk_saved_searches.go index 39b522ec..d72a0462 100644 --- a/splunk/resource_splunk_saved_searches.go +++ b/splunk/resource_splunk_saved_searches.go @@ -86,7 +86,7 @@ func savedSearches() *schema.Resource { "action_email_include_results_link": { Type: schema.TypeInt, Optional: true, - Computed: true, + Default: 1, Description: "Specify whether to include a link to the results. [1|0]", }, "action_email_include_search": { @@ -110,7 +110,7 @@ func savedSearches() *schema.Resource { "action_email_include_view_link": { Type: schema.TypeInt, Optional: true, - Computed: true, + Default: 1, Description: "Specify whether to show the title and a link to enable the user to edit the saved search. [1|0]", }, "action_email_inline": {