Documentation ¶
Index ¶
- Variables
- type EsAggByHost
- type EsAggComposite
- type EsAggTerm
- type EsAggTermField
- type EsAggregation
- type EsAggregationBucket
- type EsAggregationByHost
- type EsAggregationKey
- type EsAggs
- type EsClient
- func (esClient EsClient) CountHits(hostField string, indexes []string, query *EsQuery) (map[string]int, error)
- func (esClient EsClient) CountHitsForHost(hostName string, hostNameField string, indexes []string, query *EsQuery) (int, error)
- func (esClient *EsClient) GetHosts(hostField string, hostGroupField *string) ([]EsAggregationKey, error)
- func (esClient *EsClient) InitClient() error
- func (esClient EsClient) IsAggregatable(fieldNames []string, indexes []string) (map[string]bool, error)
- type EsFieldCapsResponse
- type EsHostAggSource
- type EsHostGroupAggSource
- type EsQuery
- type EsQueryBool
- type EsQueryStr
- type EsSearchBody
- type EsSearchHits
- type EsSearchHitsTotal
- type EsSearchResponse
- type KAttributes
- type KBulkGetSORequestItem
- type KBulkGetSOResponse
- type KBulkResolveSOResponse
- type KError
- type KFilter
- type KMeta
- type KSavedObject
- type KSavedObjectsResponse
- type KTimeFilter
- type KibanaClient
- func (client *KibanaClient) BulkGetSO(savedObjectType KibanaSavedObjectType, ids []string) []KSavedObject
- func (client *KibanaClient) BulkResolveSO(savedObjectType KibanaSavedObjectType, ids []string) []KSavedObject
- func (client *KibanaClient) FindSO(savedObjectType KibanaSavedObjectType, ...) []KSavedObject
- func (client *KibanaClient) GetDefaultIndexID() string
- func (client *KibanaClient) InitClient() error
- func (client *KibanaClient) RetrieveIndexTitles(storedQuery KSavedObject) []string
- func (client *KibanaClient) RetrieveStoredQueries(titles []string) []KSavedObject
- type KibanaSavedObjectSearchField
- type KibanaSavedObjectType
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
var FilterHostsWithLucene = ""
Functions ¶
This section is empty.
Types ¶
type EsAggByHost ¶
type EsAggByHost struct {
Composite EsAggComposite `json:"composite"`
}
type EsAggComposite ¶
type EsAggComposite struct { Size int `json:"size"` Sources []interface{} `json:"sources"` After interface{} `json:"after,omitempty"` }
type EsAggTerm ¶
type EsAggTerm struct {
Term EsAggTermField `json:"terms"`
}
type EsAggTermField ¶
type EsAggTermField struct {
Field string `json:"field"`
}
type EsAggregation ¶
type EsAggregation struct { AfterKey *EsAggregationKey `json:"after_key,omitempty"` Buckets []EsAggregationBucket `json:"buckets"` }
type EsAggregationBucket ¶
type EsAggregationBucket struct { Key EsAggregationKey `json:"key"` DocsCount int `json:"doc_count"` }
type EsAggregationByHost ¶
type EsAggregationByHost struct {
Aggregation EsAggregation `json:"_by_host"`
}
type EsAggregationKey ¶
type EsAggs ¶
type EsAggs struct {
Agg EsAggByHost `json:"_by_host"`
}
type EsClient ¶
type EsClient struct { Addresses []string // A list of Elasticsearch nodes to use Username string // Username for HTTP Basic Authentication Password string // Password for HTTP Basic Authentication // contains filtered or unexported fields }
func (EsClient) CountHitsForHost ¶
func (*EsClient) GetHosts ¶
func (esClient *EsClient) GetHosts(hostField string, hostGroupField *string) ([]EsAggregationKey, error)
func (*EsClient) InitClient ¶
type EsFieldCapsResponse ¶
type EsFieldCapsResponse struct {
Fields map[string]interface{} `json:"fields"`
}
type EsHostAggSource ¶
type EsHostAggSource struct {
HostTerm EsAggTerm `json:"host"`
}
type EsHostGroupAggSource ¶
type EsHostGroupAggSource struct {
HostGroupTerm EsAggTerm `json:"host_group"`
}
type EsQuery ¶
type EsQuery struct { Bool *EsQueryBool `json:"bool,omitempty"` Str *EsQueryStr `json:"query_string,omitempty"` }
func BuildEsQuery ¶
func BuildEsQuery(storedQuery KSavedObject) EsQuery
= buildEsQuery method in /kibana/src/plugins/data/common/es_query/es_query/build_es_query.ts
type EsQueryBool ¶
type EsQueryBool struct { Must []interface{} `json:"must"` Filter []interface{} `json:"filter"` Should []interface{} `json:"should"` MustNot []interface{} `json:"must_not"` }
type EsQueryStr ¶
type EsSearchBody ¶
type EsSearchHits ¶
type EsSearchHits struct {
Total EsSearchHitsTotal `json:"total"`
}
type EsSearchHitsTotal ¶
type EsSearchHitsTotal struct {
Value int `json:"value"`
}
type EsSearchResponse ¶
type EsSearchResponse struct { Hits EsSearchHits `json:"hits"` Aggregations EsAggregationByHost `json:"aggregations,omitempty"` }
type KAttributes ¶
type KBulkGetSORequestItem ¶
type KBulkGetSOResponse ¶
type KBulkGetSOResponse struct { SavedObjects []struct { KBulkGetSORequestItem Attributes *KAttributes `json:"attributes,omitempty"` Error *KError `json:"error,omitempty"` } `json:"saved_objects"` }
type KBulkResolveSOResponse ¶
type KBulkResolveSOResponse struct { ResolvedObjects []struct { SavedObject struct { KBulkGetSORequestItem Attributes *KAttributes `json:"attributes,omitempty"` Error *KError `json:"error,omitempty"` } `json:"saved_object"` Outcome string `json:"outcome"` } `json:"resolved_objects"` }
type KFilter ¶
type KFilter struct { Meta *KMeta `json:"meta,omitempty"` Query interface{} `json:"query,omitempty"` Exists interface{} `json:"exists,omitempty"` Range interface{} `json:"range,omitempty"` }
type KSavedObject ¶
type KSavedObject struct { Type string `json:"type"` ID string `json:"id"` Attributes *KAttributes `json:"attributes,omitempty"` }
func (*KSavedObject) ExtractIndexIds ¶
func (storedQuery *KSavedObject) ExtractIndexIds() []string
Extracts indexes's ids linked to stored query's filters
type KSavedObjectsResponse ¶
type KSavedObjectsResponse struct { Page int `json:"page"` PerPage int `json:"per_page"` Total int `json:"total"` SavedObjects []KSavedObject `json:"saved_objects"` }
type KTimeFilter ¶
type KTimeFilter struct { From string `json:"from"` To string `json:"to"` Override *bool `json:"override,omitempty"` }
func (*KTimeFilter) ToTimeInterval ¶
func (timeFilter *KTimeFilter) ToTimeInterval() *transit.TimeInterval
ToTimeInterval converts timeFilter's from/to values to Time in local time zone and returns TimeInterval with appropriate StartTime/EndTime
type KibanaClient ¶
type KibanaClient struct { APIRoot string Username string Password string // contains filtered or unexported fields }
func (*KibanaClient) BulkGetSO ¶
func (client *KibanaClient) BulkGetSO(savedObjectType KibanaSavedObjectType, ids []string) []KSavedObject
BulkGetSO performs bulk get of saved objects for provided type and ids
func (*KibanaClient) BulkResolveSO ¶
func (client *KibanaClient) BulkResolveSO(savedObjectType KibanaSavedObjectType, ids []string) []KSavedObject
BulkResolveSO performs bulk resolve of saved objects for provided type and ids
func (*KibanaClient) FindSO ¶
func (client *KibanaClient) FindSO(savedObjectType KibanaSavedObjectType, searchField KibanaSavedObjectSearchField, searchValues []string) []KSavedObject
FindSO finds saved objects of provided type and searchField matching searchValues if both searchField and searchValue set
func (*KibanaClient) GetDefaultIndexID ¶
func (client *KibanaClient) GetDefaultIndexID() string
func (*KibanaClient) InitClient ¶
func (client *KibanaClient) InitClient() error
func (*KibanaClient) RetrieveIndexTitles ¶
func (client *KibanaClient) RetrieveIndexTitles(storedQuery KSavedObject) []string
RetrieveIndexTitles extracts index patterns titles associated with provided stored query
func (*KibanaClient) RetrieveStoredQueries ¶
func (client *KibanaClient) RetrieveStoredQueries(titles []string) []KSavedObject
Extracts stored queries with provided titles If no titles provided extracts all stored queries
type KibanaSavedObjectSearchField ¶
type KibanaSavedObjectSearchField string
const (
Title KibanaSavedObjectSearchField = "title"
)
type KibanaSavedObjectType ¶
type KibanaSavedObjectType string
const ( StoredQuery KibanaSavedObjectType = "query" IndexPattern KibanaSavedObjectType = "index-pattern" )