source

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 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.4.0"
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 ParseSearchResults added in v0.4.0

func ParseSearchResults(results []byte) (jsonBytes []byte, err error)

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 MetricsLSResponse

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

type NovaIncomingEventNonReporting added in v0.4.0

type NovaIncomingEventNonReporting []struct {
	Payload struct {
		Event struct {
			Raw string `json:"raw"`
		} `json:"event"`
	} `json:"event"`
	Source string `json:"source"`
	Time   string `json:"time"`
}

type NovaIncomingEventReporting added in v0.4.0

type NovaIncomingEventReporting []struct {
	Payload interface{} `json:"event"`
	Source  string      `json:"source"`
	Time    string      `json:"time"`
}

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) GetLs

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

func (*NovaMetricsSearch) GetStats added in v0.4.0

func (n *NovaMetricsSearch) GetStats(metric_names, stats, groupBy []string, span string) (data StrMatrix, err error)

func (*NovaMetricsSearch) WaitAndLogErrors

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

WaitAndLogErrors blocks on the pipeline to complete and logs all errors

type NovaOutgoingEventFormat added in v0.4.0

type NovaOutgoingEventFormat struct {
	Source string            `json:"source"`
	Entity string            `json:"entity"`
	Event  map[string]string `json:"event"`
}

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(searchTerms, transforms, report string) (data StrMatrix)

func (*NovaSearch) WaitAndLogErrors

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

WaitAndLogErrors blocks on the pipeline to complete and logs all errors

type NovaSearchEventsQuery added in v0.4.0

type NovaSearchEventsQuery struct {
	Blocking    bool     `json:"blocking"`
	Mode        string   `json:"mode"`
	SearchTerms string   `json:"search_terms"`
	Transforms  []string `json:"transforms"`
	Reports     []string `json:"reports"`
}

type NovaSearchResponse added in v0.4.0

type NovaSearchResponse struct {
	Errors []string      `json:"errors"`
	Items  []interface{} `json:"items"`
	Job    struct {
		SearchID    string `json:"search_id"`
		SearchClass string `json:"search_class"`
		Status      string `json:"status"`
	} `json:"job"`
	Metadata struct {
		Count      int `json:"count"`
		Offset     int `json:"offset"`
		TotalCount int `json:"total_count"`
	} `json:"metadata"`
}

type NovaSearchStatsQuery added in v0.4.0

type NovaSearchStatsQuery struct {
	Fields     []string `json:"fields"`
	FieldsType string   `json:"fields_type"`
	GroupBy    []string `json:"group_by"`
	Stats      []string `json:"stats"`
	Blocking   bool     `json:"blocking"`
	Span       string   `json:"span"`
}

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