splunk

package
v2.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*Config
	*http.Client
}

Client contains Splunk config information as well as an http client for requests.

func NewClient

func NewClient(c *Config, sc *scalersconfig.ScalerConfig) (*Client, error)

NewClient returns a new Splunk client.

func (*Client) SavedSearch

func (c *Client) SavedSearch(name string) (*SearchResponse, error)

SavedSearch fetches the results of a saved search/report in Splunk.

type Config

type Config struct {
	Host        string
	Username    string
	Password    string
	APIToken    string
	HTTPTimeout time.Duration
	UnsafeSsl   bool
}

Config contains the information required to authenticate with a Splunk instance.

type SearchResponse

type SearchResponse struct {
	Result map[string]string `json:"result"`
}

SearchResponse is used for unmarshalling search results.

func (*SearchResponse) ToMetric

func (s *SearchResponse) ToMetric(valueField string) (float64, error)

ToMetric converts a search response to a consumable metric value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL