Documentation ¶
Overview ¶
Package splunksearchapireceiver contains the Splunk Search API receiver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // TokenTypeBearer is the token type for Bearer tokens TokenTypeBearer = "Bearer" // TokenTypeSplunk is the token type for Splunk tokens TokenTypeSplunk = "Splunk" )
Functions ¶
func NewFactory ¶
NewFactory creates a factory for Splunk Search API receiver
Types ¶
type Config ¶
type Config struct { confighttp.ClientConfig `mapstructure:",squash"` Endpoint string `mapstructure:"endpoint"` Username string `mapstructure:"splunk_username,omitempty"` Password string `mapstructure:"splunk_password,omitempty"` AuthToken string `mapstructure:"auth_token,omitempty"` TokenType string `mapstructure:"token_type,omitempty"` Searches []Search `mapstructure:"searches"` JobPollInterval time.Duration `mapstructure:"job_poll_interval"` StorageID *component.ID `mapstructure:"storage"` }
Config struct to represent the configuration for the Splunk Search API receiver
type CreateJobResponse ¶
type CreateJobResponse struct {
SID string `xml:"sid"`
}
CreateJobResponse struct to represent the XML response from Splunk create job endpoint https://docs.splunk.com/Documentation/Splunk/9.3.1/RESTREF/RESTsearch#search.2Fjobs
type EventRecord ¶
EventRecord struct stores the offset of the last event exported successfully
type Key ¶
type Key struct { Name string `xml:"name,attr"` Value string `xml:",chardata"` Dict *Dict `xml:"dict,omitempty"` List *List `xml:"list,omitempty"` }
Key struct to represent <s:key> elements
type List ¶
type List struct { Items []struct { Value string `xml:",chardata"` } `xml:"item"` }
List struct to represent <s:list> elements
type Search ¶
type Search struct { Query string `mapstructure:"query"` EarliestTime string `mapstructure:"earliest_time"` LatestTime string `mapstructure:"latest_time"` Limit int `mapstructure:"limit"` EventBatchSize int `mapstructure:"event_batch_size"` }
Search struct to represent a Splunk search
type SearchJobContent ¶
SearchJobContent struct to represent <content> elements
type SearchJobStatusResponse ¶
type SearchJobStatusResponse struct {
Content SearchJobContent `xml:"content"`
}
SearchJobStatusResponse struct to represent the XML response from Splunk job status endpoint https://docs.splunk.com/Documentation/Splunk/9.3.1/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D
type SearchResults ¶
type SearchResults struct { InitOffset int `json:"init_offset"` Results []struct { Raw string `json:"_raw"` Time string `json:"_time"` } `json:"results"` }
SearchResults struct to represent the JSON response from Splunk search results endpoint https://docs.splunk.com/Documentation/Splunk/9.3.1/RESTREF/RESTsearch#search.2Fv2.2Fjobs.2F.7Bsearch_id.7D.2Fresults