Documentation
¶
Index ¶
- type DeleteSearchJob
- type ExportResultsQueryParams
- type ExportResultsoutputMode
- type FieldsSummary
- type Iterator
- type ListEventsSummaryQueryParams
- func (q ListEventsSummaryQueryParams) SetCount(v int32) ListEventsSummaryQueryParams
- func (q ListEventsSummaryQueryParams) SetEarliest(v string) ListEventsSummaryQueryParams
- func (q ListEventsSummaryQueryParams) SetField(v string) ListEventsSummaryQueryParams
- func (q ListEventsSummaryQueryParams) SetLatest(v string) ListEventsSummaryQueryParams
- func (q ListEventsSummaryQueryParams) SetOffset(v int32) ListEventsSummaryQueryParams
- type ListFieldsSummaryQueryParams
- type ListJobsQueryParams
- type ListPreviewResultsQueryParams
- type ListPreviewResultsResponse
- type ListPreviewResultsResponseFields
- type ListResultsQueryParams
- type ListSearchResultsResponse
- type Message
- type MessageType
- type QueryFunc
- type QueryParameters
- type SearchJob
- type SearchStatus
- type Service
- func (s *Service) CreateJob(searchJob SearchJob, resp ...*http.Response) (*SearchJob, error)
- func (s *Service) DeleteJob(deleteSearchJob DeleteSearchJob, resp ...*http.Response) (*DeleteSearchJob, error)
- func (s *Service) ExportResults(sid string, query *ExportResultsQueryParams, resp ...*http.Response) (*map[string]interface{}, error)
- func (s *Service) GetJob(sid string, resp ...*http.Response) (*SearchJob, error)
- func (s *Service) ListEventsSummary(sid string, query *ListEventsSummaryQueryParams, resp ...*http.Response) (*ListSearchResultsResponse, error)
- func (s *Service) ListFieldsSummary(sid string, query *ListFieldsSummaryQueryParams, resp ...*http.Response) (*FieldsSummary, error)
- func (s *Service) ListJobs(query *ListJobsQueryParams, resp ...*http.Response) ([]SearchJob, error)
- func (s *Service) ListPreviewResults(sid string, query *ListPreviewResultsQueryParams, resp ...*http.Response) (*ListPreviewResultsResponse, error)
- func (s *Service) ListResults(sid string, query *ListResultsQueryParams, resp ...*http.Response) (*ListSearchResultsResponse, error)
- func (s *Service) ListTimeBuckets(sid string, resp ...*http.Response) (*TimeBucketsSummary, error)
- func (s *Service) UpdateJob(sid string, updateJob UpdateJob, resp ...*http.Response) (*SearchJob, error)
- func (s *Service) WaitForJob(jobID string, pollInterval time.Duration) (interface{}, error)
- type Servicer
- type ServicerGenerated
- type SingleFieldSummary
- type SingleTimeBucket
- type SingleValueMode
- type TimeBucketsSummary
- type UpdateJob
- type UpdateJobStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteSearchJob ¶ added in v1.6.0
type DeleteSearchJob struct {
// The index to delete the events from.
Index string `json:"index"`
// The module to run the delete search job in. The default module is used if the module field is empty.
Module string `json:"module"`
// The predicate expression that identifies the events to delete from the index. This expression must return true or false. To delete all events from the index, specify \"true\" instead of an expression.
Predicate string `json:"predicate"`
// Specifies that the delete search job contains side effects, with possible security risks.
AllowSideEffects *bool `json:"allowSideEffects,omitempty"`
// This property does not apply to delete search jobs endpoint and is set to false by default.
CollectEventSummary *bool `json:"collectEventSummary,omitempty"`
// This property does not apply to delete search jobs endpoint and is set to false by default.
CollectFieldSummary *bool `json:"collectFieldSummary,omitempty"`
// This property does not apply to delete search jobs endpoint and is set to false by default.
CollectTimeBuckets *bool `json:"collectTimeBuckets,omitempty"`
// The time, in GMT, that the search job is finished. Empty if the search job has not completed.
CompletionTime *string `json:"completionTime,omitempty"`
// The time, in GMT, that the search job is dispatched.
DispatchTime *string `json:"dispatchTime,omitempty"`
// This property does not apply to delete search jobs endpoint and is set to false by default.
EnablePreview *bool `json:"enablePreview,omitempty"`
// Specifies how the Search service should extract fields. Valid values include 'all', 'none', or 'indexed'. 'all' will extract all fields, 'indexed' will extract only indexed fields, and 'none' will extract only the default fields. This parameter overwrites the value of the 'extractAllFields' parameter. Set to 'none' for better search performance.
ExtractFields *string `json:"extractFields,omitempty"`
// The amount of time, in seconds, to run the delete search job before finalizing the search. The maximum value is 3600 seconds (1 hour).
MaxTime *int32 `json:"maxTime,omitempty"`
Messages []Message `json:"messages,omitempty"`
// The name of the search job.
Name *string `json:"name,omitempty"`
// An estimate of the percent of time remaining before the delete search job completes.
PercentComplete *int32 `json:"percentComplete,omitempty"`
// This property does not apply to delete search jobs endpoint and is set to false by default.
PreviewAvailable *string `json:"previewAvailable,omitempty"`
// The SPL search string that includes the index, module, and predicate that you specify.
Query *string `json:"query,omitempty"`
// Represents parameters on the search job such as 'earliest' and 'latest'.
QueryParameters *QueryParameters `json:"queryParameters,omitempty"`
// This property does not apply to delete search jobs endpoint and is set to 0 by default.
RequiredFreshness *int32 `json:"requiredFreshness,omitempty"`
// The earliest time specified as an absolute value in GMT. The time is computed based on the values you specify for the 'timezone' and 'earliest' queryParameters.
ResolvedEarliest *string `json:"resolvedEarliest,omitempty"`
// The latest time specified as an absolute value in GMT. The time is computed based on the values you specify for the 'timezone' and 'earliest' queryParameters.
ResolvedLatest *string `json:"resolvedLatest,omitempty"`
// The number of results produced so far by the delete search job that are going to be deleted.
ResultsAvailable *int32 `json:"resultsAvailable,omitempty"`
// This property does not apply to delete search jobs endpoint and is set to 0 by default.
ResultsPreviewAvailable *int32 `json:"resultsPreviewAvailable,omitempty"`
// The ID assigned to the delete search job.
Sid *string `json:"sid,omitempty"`
Status *SearchStatus `json:"status,omitempty"`
}
A delete search job, including read-only fields that includes the required properties.
type ExportResultsQueryParams ¶
type ExportResultsQueryParams struct {
// Count : The maximum number of jobs that you want to return the status entries for.
Count *int32 `key:"count"`
// Filename : The export results filename. Default: exportResults
Filename string `key:"filename"`
// OutputMode : Specifies the format for the returned output.
OutputMode ExportResultsoutputMode `key:"outputMode"`
}
ExportResultsQueryParams represents valid query parameters for the ExportResults operation For convenience ExportResultsQueryParams can be formed in a single statement, for example:
`v := ExportResultsQueryParams{}.SetCount(...).SetFilename(...).SetOutputMode(...)`
func (ExportResultsQueryParams) SetCount ¶
func (q ExportResultsQueryParams) SetCount(v int32) ExportResultsQueryParams
func (ExportResultsQueryParams) SetFilename ¶
func (q ExportResultsQueryParams) SetFilename(v string) ExportResultsQueryParams
func (ExportResultsQueryParams) SetOutputMode ¶
func (q ExportResultsQueryParams) SetOutputMode(v ExportResultsoutputMode) ExportResultsQueryParams
type ExportResultsoutputMode ¶
type ExportResultsoutputMode string
ExportResultsoutputMode : Specifies the format for the returned output.
const ( ExportResultsoutputModeCsv ExportResultsoutputMode = "csv" ExportResultsoutputModeJson ExportResultsoutputMode = "json" )
List of ExportResultsoutputMode values
type FieldsSummary ¶
type FieldsSummary struct {
// The amount of time, in seconds, that a time bucket spans from the earliest to the latest time.
Duration *float64 `json:"duration,omitempty"`
// The earliest timestamp, in UTC format, of the events to process.
EarliestTime *string `json:"earliestTime,omitempty"`
// The total number of events for all fields returned in the time range (earliestTime and latestTime) specified.
EventCount *int32 `json:"eventCount,omitempty"`
// A list of the fields in the time range specified.
Fields map[string]SingleFieldSummary `json:"fields,omitempty"`
// The latest timestamp, in UTC format, of the events to process.
LatestTime *string `json:"latestTime,omitempty"`
}
A statistical summary of the fields in the events to date, for the search ID (SID).
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator is the result of a search query. Its cursor starts at 0 index of the result set. Use Next() to advance through the rows:
search, _ := client.SearchService.SubmitSearch(&PostJobsRequest{Search: "search index=main | head 5"})
pages, _ := search.QueryResults(2, 0, &FetchResultsRequest{Count: 5})
defer pages.Close()
for pages.Next() {
values, err := pages.Value()
...
}
err := pages.Err() // get any error encountered during iteration
...
func NewIterator ¶
NewIterator creates a new reference to the iterator object
func (*Iterator) Close ¶
func (i *Iterator) Close()
Close checks the status and closes iterator if it's not already. After Close, no results can be retrieved
func (*Iterator) Next ¶
Next prepares the next result set for reading with the Value method. It returns true on success, or false if there is no next result row or an error occurred while preparing it.
Every call to Value, even the first one, must be preceded by a call to Next.
func (*Iterator) Value ¶
func (i *Iterator) Value() (*ListSearchResultsResponse, error)
Value returns value in current iteration or error out if iterator is closed
type ListEventsSummaryQueryParams ¶
type ListEventsSummaryQueryParams struct {
// Count : The maximum number of jobs that you want to return the status entries for.
Count *int32 `key:"count"`
// Earliest : The earliest time filter, in absolute time. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2021-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored.
Earliest string `key:"earliest"`
// Field : One or more fields to return for the result set. Use a comma-separated list of field names to specify multiple fields.
Field string `key:"field"`
// Latest : The latest time filter in absolute time. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2021-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored.
Latest string `key:"latest"`
// Offset : Index number identifying the location of the first item to return.
Offset *int32 `key:"offset"`
}
ListEventsSummaryQueryParams represents valid query parameters for the ListEventsSummary operation For convenience ListEventsSummaryQueryParams can be formed in a single statement, for example:
`v := ListEventsSummaryQueryParams{}.SetCount(...).SetEarliest(...).SetField(...).SetLatest(...).SetOffset(...)`
func (ListEventsSummaryQueryParams) SetCount ¶
func (q ListEventsSummaryQueryParams) SetCount(v int32) ListEventsSummaryQueryParams
func (ListEventsSummaryQueryParams) SetEarliest ¶
func (q ListEventsSummaryQueryParams) SetEarliest(v string) ListEventsSummaryQueryParams
func (ListEventsSummaryQueryParams) SetField ¶
func (q ListEventsSummaryQueryParams) SetField(v string) ListEventsSummaryQueryParams
func (ListEventsSummaryQueryParams) SetLatest ¶
func (q ListEventsSummaryQueryParams) SetLatest(v string) ListEventsSummaryQueryParams
func (ListEventsSummaryQueryParams) SetOffset ¶
func (q ListEventsSummaryQueryParams) SetOffset(v int32) ListEventsSummaryQueryParams
type ListFieldsSummaryQueryParams ¶
type ListFieldsSummaryQueryParams struct {
// Earliest : The earliest time filter, in absolute time. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2021-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored.
Earliest string `key:"earliest"`
// Latest : The latest time filter in absolute time. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2021-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored.
Latest string `key:"latest"`
}
ListFieldsSummaryQueryParams represents valid query parameters for the ListFieldsSummary operation For convenience ListFieldsSummaryQueryParams can be formed in a single statement, for example:
`v := ListFieldsSummaryQueryParams{}.SetEarliest(...).SetLatest(...)`
func (ListFieldsSummaryQueryParams) SetEarliest ¶
func (q ListFieldsSummaryQueryParams) SetEarliest(v string) ListFieldsSummaryQueryParams
func (ListFieldsSummaryQueryParams) SetLatest ¶
func (q ListFieldsSummaryQueryParams) SetLatest(v string) ListFieldsSummaryQueryParams
type ListJobsQueryParams ¶
type ListJobsQueryParams struct {
// Count : The maximum number of jobs that you want to return the status entries for.
Count *int32 `key:"count"`
// Filter : Filter the list of jobs by 'sid'. Valid format is `sid IN ({comma-separated list of SIDs. Each SID must be enclosed in double quotation marks.})`. A maximum of 50 SIDs can be specified in one query.
Filter string `key:"filter"`
// Status : Filter the list of jobs by status. Valid status values are 'running', 'done', 'canceled', or 'failed'.
Status SearchStatus `key:"status"`
}
ListJobsQueryParams represents valid query parameters for the ListJobs operation For convenience ListJobsQueryParams can be formed in a single statement, for example:
`v := ListJobsQueryParams{}.SetCount(...).SetFilter(...).SetStatus(...)`
func (ListJobsQueryParams) SetCount ¶
func (q ListJobsQueryParams) SetCount(v int32) ListJobsQueryParams
func (ListJobsQueryParams) SetFilter ¶ added in v1.2.1
func (q ListJobsQueryParams) SetFilter(v string) ListJobsQueryParams
func (ListJobsQueryParams) SetStatus ¶
func (q ListJobsQueryParams) SetStatus(v SearchStatus) ListJobsQueryParams
type ListPreviewResultsQueryParams ¶
type ListPreviewResultsQueryParams struct {
// Count : The maximum number of jobs that you want to return the status entries for.
Count *int32 `key:"count"`
// Offset : Index number identifying the location of the first item to return.
Offset *int32 `key:"offset"`
}
ListPreviewResultsQueryParams represents valid query parameters for the ListPreviewResults operation For convenience ListPreviewResultsQueryParams can be formed in a single statement, for example:
`v := ListPreviewResultsQueryParams{}.SetCount(...).SetOffset(...)`
func (ListPreviewResultsQueryParams) SetCount ¶
func (q ListPreviewResultsQueryParams) SetCount(v int32) ListPreviewResultsQueryParams
func (ListPreviewResultsQueryParams) SetOffset ¶
func (q ListPreviewResultsQueryParams) SetOffset(v int32) ListPreviewResultsQueryParams
type ListPreviewResultsResponse ¶
type ListPreviewResultsResponse struct {
IsPreviewStable bool `json:"isPreviewStable"`
Results []map[string]interface{} `json:"results"`
Fields []ListPreviewResultsResponseFields `json:"fields,omitempty"`
Messages []Message `json:"messages,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
Wait *string `json:"wait,omitempty"`
}
The structure of the response body for the preview search results that is returned for the job with the specified search ID (SID). When search is running, it might return incomplete or truncated search results. The isPreviewStable property indicates whether the returned preview results stucture is stable or not. Truncated preview results occur because the number of requested results exceeds the page limit. Use the 'nextLink' URL to retrieve the next page of results.
type ListPreviewResultsResponseFields ¶ added in v1.10.0
type ListPreviewResultsResponseFields struct {
Name string `json:"name"`
DataSource *string `json:"dataSource,omitempty"`
GroupbyRank *string `json:"groupbyRank,omitempty"`
SplitField *string `json:"splitField,omitempty"`
SplitValue *string `json:"splitValue,omitempty"`
SplitbySpecial *string `json:"splitbySpecial,omitempty"`
TypeSpecial *string `json:"typeSpecial,omitempty"`
}
type ListResultsQueryParams ¶
type ListResultsQueryParams struct {
// Count : The maximum number of jobs that you want to return the status entries for.
Count *int32 `key:"count"`
// Field : One or more fields to return for the result set. Use a comma-separated list of field names to specify multiple fields.
Field string `key:"field"`
// Offset : Index number identifying the location of the first item to return.
Offset *int32 `key:"offset"`
}
ListResultsQueryParams represents valid query parameters for the ListResults operation For convenience ListResultsQueryParams can be formed in a single statement, for example:
`v := ListResultsQueryParams{}.SetCount(...).SetField(...).SetOffset(...)`
func (ListResultsQueryParams) SetCount ¶
func (q ListResultsQueryParams) SetCount(v int32) ListResultsQueryParams
func (ListResultsQueryParams) SetField ¶
func (q ListResultsQueryParams) SetField(v string) ListResultsQueryParams
func (ListResultsQueryParams) SetOffset ¶
func (q ListResultsQueryParams) SetOffset(v int32) ListResultsQueryParams
type ListSearchResultsResponse ¶
type ListSearchResultsResponse struct {
Results []map[string]interface{} `json:"results"`
Fields []ListPreviewResultsResponseFields `json:"fields,omitempty"`
Messages []Message `json:"messages,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
Wait *string `json:"wait,omitempty"`
}
The structure of the search results or events metadata that is returned for the job with the specified search ID (SID). When search is running, it might return incomplete or truncated search results. Incomplete search results occur when a search has not completed. Wait until search completes for full result set. Truncated search results occur because the number of requested results exceeds the page limit. Use the 'nextLink' URL to retrieve the next page of results.
type Message ¶
type Message struct {
Text *string `json:"text,omitempty"`
Type *MessageType `json:"type,omitempty"`
}
The message field in search results or search jobs. The types of messages are INFO, DEBUG, FATAL, and ERROR.
type MessageType ¶
type MessageType string
const ( MessageTypeInfo MessageType = "INFO" MessageTypeDebug MessageType = "DEBUG" MessageTypeFatal MessageType = "FATAL" MessageTypeError MessageType = "ERROR" )
List of MessageType
type QueryFunc ¶
type QueryFunc func(step, start int) (*ListSearchResultsResponse, error)
QueryFunc is the function to be executed in each Next call of the iterator
type QueryParameters ¶
type QueryParameters struct {
// The earliest time, in absolute or relative format, to retrieve events. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2021-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored.
Earliest *string `json:"earliest,omitempty"`
// The latest time, in absolute or relative format, to retrieve events. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2021-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored.
Latest *string `json:"latest,omitempty"`
// Specify a time string to set the absolute time used for any relative time specifier in the search. Defaults to the current system time. You can specify a relative time modifier ('earliest' or 'latest') for this parameter. For example, if 'earliest' is set to -d and the 'relativeTimeAnchor' is set to '2021-01-05T13:15:30Z' then 'resolvedEarliest' is '2021-01-04T13:15:30Z'.
RelativeTimeAnchor *string `json:"relativeTimeAnchor,omitempty"`
// The timezone that relative time modifiers are based off of. Timezone only applies to relative time literals for 'earliest' and 'latest'. If UNIX time or UTC format is used for 'earliest' and 'latest', this field is ignored. For the list of supported timezone formats, see https://docs.splunk.com/Documentation/Splunk/latest/Data/Applytimezoneoffsetstotimestamps#zoneinfo_.28TZ.29_database type: string default: \"GMT\"
Timezone interface{} `json:"timezone,omitempty"`
}
Represents parameters on the search job such as 'earliest' and 'latest'.
type SearchJob ¶
type SearchJob struct {
// The SPL search string.
Query string `json:"query"`
// Specifies whether a search that contains commands with side effects (with possible security risks) is allowed to run.
AllowSideEffects *bool `json:"allowSideEffects,omitempty"`
// Specifies whether a search is allowed to collect event summary information during the run time.
CollectEventSummary *bool `json:"collectEventSummary,omitempty"`
// Specifies whether a search is allowed to collect field summary information during the run time.
CollectFieldSummary *bool `json:"collectFieldSummary,omitempty"`
// Specifies whether a search is allowed to collect timeline bucket summary information during the run time.
CollectTimeBuckets *bool `json:"collectTimeBuckets,omitempty"`
// The time, in GMT, that the search job is finished. Empty if the search job has not completed.
CompletionTime *string `json:"completionTime,omitempty"`
// The time, in GMT, that the search job is dispatched.
DispatchTime *string `json:"dispatchTime,omitempty"`
// Specifies whether a search is allowed to collect preview results during the run time.
EnablePreview *bool `json:"enablePreview,omitempty"`
// Specifies whether the Search service should extract all of the available fields in the data, including fields not mentioned in the SPL, for the search job. Set to 'false' for better search performance. The 'extractAllFields' parameter is deprecated as of version v3alpha1. Although this parameter continues to function, it might be removed in a future version. Use the 'extractFields' parameter instead.
ExtractAllFields *bool `json:"extractAllFields,omitempty"`
// Specifies how the Search service should extract fields. Valid values include 'all', 'none', or 'indexed'. Use 'all' to extract all fields. Use 'indexed' to extract only indexed fields. Use 'none' to extract only the default fields.
ExtractFields *string `json:"extractFields,omitempty"`
// The number of seconds to run the search before finalizing the search. The maximum value is 3600 seconds (1 hour).
MaxTime *int32 `json:"maxTime,omitempty"`
Messages []Message `json:"messages,omitempty"`
// The module to run the search in. The default module is used if a module is not specified.
Module *string `json:"module,omitempty"`
// The name of the search job.
Name *string `json:"name,omitempty"`
// An estimate of the percent of time remaining before the job completes.
PercentComplete *int32 `json:"percentComplete,omitempty"`
// Specifies if preview results for the search job are available. The valid status values are 'unknown', 'true', and 'false'. You must set the 'enablePreview=true' parameter to return preview search results.
PreviewAvailable *string `json:"previewAvailable,omitempty"`
// Represents parameters on the search job such as 'earliest' and 'latest'.
QueryParameters *QueryParameters `json:"queryParameters,omitempty"`
// Specifies a maximum time interval, in seconds, between identical existing searches. The 'requiredFreshness' parameter is used to determine if an existing search with the same query and the same time boundaries can be reused, instead of running the same search again. Freshness is applied to the 'resolvedEarliest' and 'resolvedLatest' parameters. If an existing search has the same exact criteria as this search and the 'resolvedEarliest' and 'resolvedLatest' values are within the freshness interval, the existing search metadata is returned instead of initiating a new search job. By default, the 'requiredFreshness' parameter is set to 0 which means that the platform does not attempt to use an existing search. The maximum value for the 'requiredFreshness' parameter is 259200 seconds (72 hours).
RequiredFreshness *int32 `json:"requiredFreshness,omitempty"`
// The earliest time specified as an absolute value in GMT. The time is computed based on the values you specify for the 'timezone' and 'earliest' queryParameters.
ResolvedEarliest *string `json:"resolvedEarliest,omitempty"`
// The latest time specified as an absolute value in GMT. The time is computed based on the values you specify for the 'timezone' and 'earliest' queryParameters.
ResolvedLatest *string `json:"resolvedLatest,omitempty"`
// The number of results produced so far for the search job.
ResultsAvailable *int32 `json:"resultsAvailable,omitempty"`
// The number of the preview search results for the job with the specified search ID (SID). You must set the 'enablePreview=true' parameter to return preview search results.
ResultsPreviewAvailable *int32 `json:"resultsPreviewAvailable,omitempty"`
// The ID assigned to the search job.
Sid *string `json:"sid,omitempty"`
Status *SearchStatus `json:"status,omitempty"`
}
A search job, including read-only fields that includes the required properties.
type SearchStatus ¶
type SearchStatus string
SearchStatus : The current status of the search job. The valid status values are 'running', 'done', 'canceled', and 'failed'.
const ( SearchStatusRunning SearchStatus = "running" SearchStatusDone SearchStatus = "done" SearchStatusCanceled SearchStatus = "canceled" SearchStatusFailed SearchStatus = "failed" )
List of SearchStatus
type Service ¶
type Service services.BaseService
func NewService ¶
NewService creates a new search service client from the given Config
func (*Service) CreateJob ¶
CreateJob - search service endpoint Creates a search job. Parameters:
searchJob resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) DeleteJob ¶ added in v1.6.0
func (s *Service) DeleteJob(deleteSearchJob DeleteSearchJob, resp ...*http.Response) (*DeleteSearchJob, error)
DeleteJob - search service endpoint Creates a search job that deletes events from an index. The events are deleted from the index in the specified module, based on the search criteria as specified by the predicate. Parameters:
deleteSearchJob resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) ExportResults ¶
func (s *Service) ExportResults(sid string, query *ExportResultsQueryParams, resp ...*http.Response) (*map[string]interface{}, error)
ExportResults - search service endpoint Exports the search results for the job with the specified search ID (SID). Export the results as a CSV file or JSON file. Parameters:
sid: The search ID. query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) GetJob ¶
GetJob - search service endpoint Returns the search job with the specified search ID (SID). Parameters:
sid: The search ID. resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) ListEventsSummary ¶
func (s *Service) ListEventsSummary(sid string, query *ListEventsSummaryQueryParams, resp ...*http.Response) (*ListSearchResultsResponse, error)
ListEventsSummary - search service endpoint Returns an events summary for search ID (SID) search. Parameters:
sid: The search ID. query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) ListFieldsSummary ¶
func (s *Service) ListFieldsSummary(sid string, query *ListFieldsSummaryQueryParams, resp ...*http.Response) (*FieldsSummary, error)
ListFieldsSummary - search service endpoint Returns a fields stats summary of the events to-date, for search ID (SID) search. Parameters:
sid: The search ID. query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) ListJobs ¶
ListJobs - search service endpoint Returns the matching list of search jobs. Parameters:
query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) ListPreviewResults ¶
func (s *Service) ListPreviewResults(sid string, query *ListPreviewResultsQueryParams, resp ...*http.Response) (*ListPreviewResultsResponse, error)
ListPreviewResults - search service endpoint Returns the preview search results for the job with the specified search ID (SID). Can be used when a job is running to return interim results. Parameters:
sid: The search ID. query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) ListResults ¶
func (s *Service) ListResults(sid string, query *ListResultsQueryParams, resp ...*http.Response) (*ListSearchResultsResponse, error)
ListResults - search service endpoint Returns the search results for the job with the specified search ID (SID). Parameters:
sid: The search ID. query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) ListTimeBuckets ¶
ListTimeBuckets - search service endpoint Returns the event distribution over time of the untransformed events read to-date, for search ID(SID) search. Parameters:
sid: The search ID. resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
func (*Service) UpdateJob ¶
func (s *Service) UpdateJob(sid string, updateJob UpdateJob, resp ...*http.Response) (*SearchJob, error)
UpdateJob - search service endpoint Updates the search job with the specified search ID (SID) with an action. Parameters:
sid: The search ID. updateJob resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
type Servicer ¶
type Servicer interface {
//interfaces that cannot be auto-generated from codegen
// WaitForJob polls the job until it's completed or errors out
WaitForJob(jobID string, pollInterval time.Duration) (interface{}, error)
//interfaces that are auto-generated in interface_generated.go
ServicerGenerated
}
Servicer represents the interface for implementing all endpoints for this service
type ServicerGenerated ¶ added in v1.10.0
type ServicerGenerated interface {
/*
CreateJob - search service endpoint
Creates a search job.
Parameters:
searchJob
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
CreateJob(searchJob SearchJob, resp ...*http.Response) (*SearchJob, error)
/*
DeleteJob - search service endpoint
Creates a search job that deletes events from an index. The events are deleted from the index in the specified module, based on the search criteria as specified by the predicate.
Parameters:
deleteSearchJob
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
DeleteJob(deleteSearchJob DeleteSearchJob, resp ...*http.Response) (*DeleteSearchJob, error)
/*
ExportResults - search service endpoint
Exports the search results for the job with the specified search ID (SID). Export the results as a CSV file or JSON file.
Parameters:
sid: The search ID.
query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
ExportResults(sid string, query *ExportResultsQueryParams, resp ...*http.Response) (*map[string]interface{}, error)
/*
GetJob - search service endpoint
Returns the search job with the specified search ID (SID).
Parameters:
sid: The search ID.
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
GetJob(sid string, resp ...*http.Response) (*SearchJob, error)
/*
ListEventsSummary - search service endpoint
Returns an events summary for search ID (SID) search.
Parameters:
sid: The search ID.
query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
ListEventsSummary(sid string, query *ListEventsSummaryQueryParams, resp ...*http.Response) (*ListSearchResultsResponse, error)
/*
ListFieldsSummary - search service endpoint
Returns a fields stats summary of the events to-date, for search ID (SID) search.
Parameters:
sid: The search ID.
query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
ListFieldsSummary(sid string, query *ListFieldsSummaryQueryParams, resp ...*http.Response) (*FieldsSummary, error)
/*
ListJobs - search service endpoint
Returns the matching list of search jobs.
Parameters:
query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
ListJobs(query *ListJobsQueryParams, resp ...*http.Response) ([]SearchJob, error)
/*
ListPreviewResults - search service endpoint
Returns the preview search results for the job with the specified search ID (SID). Can be used when a job is running to return interim results.
Parameters:
sid: The search ID.
query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
ListPreviewResults(sid string, query *ListPreviewResultsQueryParams, resp ...*http.Response) (*ListPreviewResultsResponse, error)
/*
ListResults - search service endpoint
Returns the search results for the job with the specified search ID (SID).
Parameters:
sid: The search ID.
query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
ListResults(sid string, query *ListResultsQueryParams, resp ...*http.Response) (*ListSearchResultsResponse, error)
/*
ListTimeBuckets - search service endpoint
Returns the event distribution over time of the untransformed events read to-date, for search ID(SID) search.
Parameters:
sid: The search ID.
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
ListTimeBuckets(sid string, resp ...*http.Response) (*TimeBucketsSummary, error)
/*
UpdateJob - search service endpoint
Updates the search job with the specified search ID (SID) with an action.
Parameters:
sid: The search ID.
updateJob
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
*/
UpdateJob(sid string, updateJob UpdateJob, resp ...*http.Response) (*SearchJob, error)
}
ServicerGenerated represents the interface for implementing all endpoints for this service
type SingleFieldSummary ¶
type SingleFieldSummary struct {
// The total number of events that the field appears in.
Count *int32 `json:"count,omitempty"`
// The total number of unique values in the field.
DistinctCount *int32 `json:"distinctCount,omitempty"`
// Specifies if the 'distinctCount' is accurate. When the count exceeds the maximum count, an approximate count is computed instead and the 'isExact' property is FALSE.
IsExact *bool `json:"isExact,omitempty"`
// The maximum numeric value in the field.
Max *string `json:"max,omitempty"`
// The mean (average) for the numeric value in the field.
Mean *float64 `json:"mean,omitempty"`
// The minimum numeric value in the field.
Min *string `json:"min,omitempty"`
// An array of the values in the field.
Modes []SingleValueMode `json:"modes,omitempty"`
// The count of the numeric values in the field.
NumericCount *int32 `json:"numericCount,omitempty"`
// Specifies if the field was added or changed by the search.
Relevant *bool `json:"relevant,omitempty"`
// The standard deviation for the numeric values in the field.
Stddev *float64 `json:"stddev,omitempty"`
}
Summary of each field.
type SingleTimeBucket ¶
type SingleTimeBucket struct {
// Count of available events. Not all events in a bucket are retrievable. Typically this count is capped at 10000.
AvailableCount *int32 `json:"availableCount,omitempty"`
Duration *float64 `json:"duration,omitempty"`
// The timestamp of the earliest event in the current bucket, in UNIX format. This is the same time as 'earliestTimeStrfTime' in UNIX format.
EarliestTime *float64 `json:"earliestTime,omitempty"`
// The timestamp of the earliest event in the current bucket, in UTC format with seconds. For example 2021-01-25T13:15:30Z, which follows the ISO-8601 (%FT%T.%Q) format.
EarliestTimeStrfTime *string `json:"earliestTimeStrfTime,omitempty"`
// Specifies if all of the events in the current bucket have been finalized.
IsFinalized *bool `json:"isFinalized,omitempty"`
// The total count of the events in the current bucket.
TotalCount *int32 `json:"totalCount,omitempty"`
}
The summary of events for a single time bucket.
type SingleValueMode ¶
type SingleValueMode struct {
// The number of occurrences that the value appears in a field.
Count *int32 `json:"count,omitempty"`
// Specifies if the count is accurate. When the count exceeds the maximum count, an approximate count is computed instead and the 'isExact' property is FALSE.
IsExact *bool `json:"isExact,omitempty"`
// The value in the field.
Value *string `json:"value,omitempty"`
}
Summary of the value in a field.
type TimeBucketsSummary ¶
type TimeBucketsSummary struct {
// Specifies if the events are returned in time order.
IsTimeCursored *bool `json:"IsTimeCursored,omitempty"`
Buckets []SingleTimeBucket `json:"buckets,omitempty"`
// Identifies where the cursor is in processing the events. The 'cursorTime' is a timestamp specified in UNIX time.
CursorTime *float32 `json:"cursorTime,omitempty"`
// The number of events processed at the 'cursorTime'.
EventCount *int32 `json:"eventCount,omitempty"`
}
A timeline metadata model of the event distribution. The model shows the untransformed events that are read to date for a specific for search ID (SID).
type UpdateJob ¶
type UpdateJob struct {
// Modify the status of an existing search job using PATCH. The only status values you can PATCH are 'canceled' and 'finalized'. You can PATCH the 'canceled' status only to a search job that is running. 'finalize' means to terminate the search job, and the status will be set to 'failed'.
Status UpdateJobStatus `json:"status"`
}
Updates a search job with a status.
type UpdateJobStatus ¶
type UpdateJobStatus string
UpdateJobStatus : Modify the status of an existing search job using PATCH. The only status values you can PATCH are 'canceled' and 'finalized'. You can PATCH the 'canceled' status only to a search job that is running. 'finalize' means to terminate the search job, and the status will be set to 'failed'.
const ( UpdateJobStatusCanceled UpdateJobStatus = "canceled" UpdateJobStatusFinalized UpdateJobStatus = "finalized" )
List of UpdateJobStatus