Documentation ¶
Index ¶
- func ImportDashboards(beatName, hostname, homePath string, ...) error
- func ImportDashboardsViaElasticsearch(esLoader *ElasticsearchLoader) error
- func ImportDashboardsViaKibana(kibanaLoader *KibanaLoader) error
- func ReplaceIndexInDashboardObject(index string, content common.MapStr) common.MapStr
- func ReplaceIndexInIndexPattern(index string, content common.MapStr) common.MapStr
- func ReplaceIndexInSavedObject(index string, kibanaSavedObject map[string]interface{}) map[string]interface{}
- func ReplaceStringInDashboard(old, new string, content common.MapStr) (common.MapStr, error)
- type Config
- type ElasticsearchLoader
- type Importer
- func (imp Importer) Import() error
- func (imp Importer) ImportArchive() error
- func (imp Importer) ImportDashboard(file string) error
- func (imp Importer) ImportDir(dirType string, dir string) error
- func (imp Importer) ImportFile(fileType string, file string) error
- func (imp Importer) ImportKibanaDir(dir string) error
- type JSONFormat
- type JSONObject
- type JSONObjectAttribute
- type KibanaLoader
- type Loader
- type MessageOutputter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportDashboards ¶
func ImportDashboards( beatName, hostname, homePath string, kibanaConfig, esConfig, dashboardsConfig *common.Config, msgOutputter MessageOutputter, ) error
ImportDashboards tries to import the kibana dashboards. If the Elastic Stack is at version 6.0+, the dashboards should be installed via the kibana dashboard loader plugin. For older versions of the Elastic Stack we write the dashboards directly into the .kibana index.
func ImportDashboardsViaElasticsearch ¶
func ImportDashboardsViaElasticsearch(esLoader *ElasticsearchLoader) error
func ImportDashboardsViaKibana ¶
func ImportDashboardsViaKibana(kibanaLoader *KibanaLoader) error
Types ¶
type Config ¶
type Config struct { Enabled bool `config:"enabled"` KibanaIndex string `config:"kibana_index"` Index string `config:"index"` Dir string `config:"directory"` File string `config:"file"` Beat string `config:"beat"` URL string `config:"url"` OnlyDashboards bool `config:"only_dashboards"` OnlyIndex bool `config:"only_index"` AlwaysKibana bool `config:"always_kibana"` }
type ElasticsearchLoader ¶
type ElasticsearchLoader struct {
// contains filtered or unexported fields
}
func NewElasticsearchLoader ¶
func NewElasticsearchLoader(cfg *common.Config, dashboardsConfig *Config, msgOutputter MessageOutputter) (*ElasticsearchLoader, error)
func (ElasticsearchLoader) Close ¶
func (loader ElasticsearchLoader) Close() error
func (ElasticsearchLoader) CreateKibanaIndex ¶
func (loader ElasticsearchLoader) CreateKibanaIndex() error
CreateKibanaIndex creates the kibana index if it doesn't exists and sets some index properties which are needed as a workaround for: https://github.com/elastic/beats-dashboards/issues/94
func (ElasticsearchLoader) ImportDashboard ¶
func (loader ElasticsearchLoader) ImportDashboard(file string) error
func (ElasticsearchLoader) ImportIndex ¶
func (loader ElasticsearchLoader) ImportIndex(file string) error
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
func NewImporter ¶
func (Importer) Import ¶
Import imports the Kibana dashboards according to the configuration options.
func (Importer) ImportArchive ¶
func (Importer) ImportDashboard ¶
func (Importer) ImportKibanaDir ¶
import Kibana dashboards and index-pattern or only one of these
type JSONFormat ¶
type JSONFormat struct {
Objects []JSONObject `json:"objects"`
}
type JSONObject ¶
type JSONObject struct {
Attributes JSONObjectAttribute `json:"attributes"`
}
type JSONObjectAttribute ¶
type KibanaLoader ¶
type KibanaLoader struct {
// contains filtered or unexported fields
}
func NewKibanaLoader ¶
func NewKibanaLoader(cfg *common.Config, dashboardsConfig *Config, hostname string, msgOutputter MessageOutputter) (*KibanaLoader, error)
func (KibanaLoader) Close ¶
func (loader KibanaLoader) Close() error
func (KibanaLoader) ImportDashboard ¶
func (loader KibanaLoader) ImportDashboard(file string) error
func (KibanaLoader) ImportIndex ¶
func (loader KibanaLoader) ImportIndex(file string) error
type MessageOutputter ¶
type MessageOutputter func(msg string, a ...interface{})
MessageOutputter is a function type for injecting status logging into this module.