source

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventIngestor  = iota
	MetricIngestor = iota
)
View Source
const AppVersion = "0.3.2"
View Source
const DefaultNovaURL = "https://api.splunknova.com"

Variables

View Source
var HTTPClient *http.Client

Functions

func Get

func Get(targetURL string, params map[string]string, authHeader string) ([]byte, error)

Get makes and HTTP GET

func GetBasicAuthHeader

func GetBasicAuthHeader(clientID, clientSecret string) string

func GetCredentials

func GetCredentials(novaUrl string) (clientID, clientSecret string, err error)

func GetUserAgent

func GetUserAgent() string

func Post

func Post(targetURL string, payload io.Reader, authHeader string) ([]byte, error)

Post makes an HTTP POST

func SaveCredentials

func SaveCredentials(novaUrl string) (clientID, clientSecret string, err error)

Types

type MetricsGetResponse

type MetricsGetResponse struct {
	Aggregations []string `json:"aggregations"`
	Dimensions   []string `json:"dimensions"`
}

type MetricsLSResponse

type MetricsLSResponse struct {
	Metrics []string `json:"metrics"`
}

type NovaIngest

type NovaIngest struct {
	Source  string
	Entity  string
	Auth    string
	NovaURL string
	ErrChan chan error
	Type    int
}

NovaIngest creates a new ingest obj

func NewNovaIngestForEvents

func NewNovaIngestForEvents(novaURL, entity, auth string) *NovaIngest

func NewNovaIngestForMetrics

func NewNovaIngestForMetrics(novaURL, entity, auth string) *NovaIngest

func (*NovaIngest) Start

func (n *NovaIngest) Start(r io.Reader)

Start sends lines from stdin to nova

func (*NovaIngest) WaitAndLogErrors

func (n *NovaIngest) WaitAndLogErrors() (errorsEncountered bool)

WaitAndLogErrors blocks on the pipeline to complete and logs all errors

type NovaMetricsSearch

type NovaMetricsSearch struct {
	Auth    string
	NovaURL string
	ErrChan chan error
}

func NewNovaMetricsSearch

func NewNovaMetricsSearch(novaURL, auth string) *NovaMetricsSearch

NewNovaSearch creates a new search obj

func (*NovaMetricsSearch) GetAggregations

func (n *NovaMetricsSearch) GetAggregations(metric_names, aggregations, groupBy, span string) (StrMatrix, error)

func (*NovaMetricsSearch) GetLs

func (n *NovaMetricsSearch) GetLs() (StrMatrix, error)

func (*NovaMetricsSearch) WaitAndLogErrors

func (n *NovaMetricsSearch) WaitAndLogErrors() (errorsEncountered bool)

WaitAndLogErrors blocks on the pipeline to complete and logs all errors

type NovaResults

type NovaResults struct {
	NovaEvents []struct {
		Time string `json:"time"`
		Raw  string `json:"event.raw"`
	} `json:"events"`
}

type NovaResultsStats

type NovaResultsStats struct {
	NovaEvents []map[string]string `json:"events"`
}

type NovaSearch

type NovaSearch struct {
	Auth    string
	NovaURL string
	ErrChan chan error
}

func NewNovaSearch

func NewNovaSearch(novaURL, auth string) *NovaSearch

NewNovaSearch creates a new search obj

func (*NovaSearch) Search

func (n *NovaSearch) Search(keywords, transforms, report string) StrMatrix

func (*NovaSearch) WaitAndLogErrors

func (n *NovaSearch) WaitAndLogErrors() (errorsEncountered bool)

WaitAndLogErrors blocks on the pipeline to complete and logs all errors

type StrMatrix

type StrMatrix [][]string

func (StrMatrix) PrintList

func (s StrMatrix) PrintList()

func (StrMatrix) PrintTable

func (s StrMatrix) PrintTable()

Jump to

Keyboard shortcuts

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