es

package
v0.0.0-...-2081a44 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIndex

func CreateIndex(nshards uint, nreplicas uint, checkStartup bool, refreshInterval time.Duration) error

func GetClient

func GetClient(config conf.ElasticDestConfig, httpClient *http.Client, logger log15.Logger) (c *elastic.Client, err error)

GetClient returns a new Elasticsearch client from the provided configuration.

If httpClient is nil, http.DefaultClient is used.

Types

type AnyField

type AnyField interface{}

type DateField

type DateField struct {
	Typ    string `json:"type"`
	Format string `json:"format"`
	Store  bool   `json:"store"`
}

func NewDateField

func NewDateField() DateField

type DynamicTemplate

type DynamicTemplate struct {
	MatchMappingType string   `json:"match_mapping_type,omitempty"`
	Match            string   `json:"match,omitempty"`
	Mapping          AnyField `json:"mapping"`
}

func DynamicBytes

func DynamicBytes() DynamicTemplate

func DynamicDatetime

func DynamicDatetime() DynamicTemplate

func DynamicNanoSeconds

func DynamicNanoSeconds() DynamicTemplate

func DynamicPID

func DynamicPID() DynamicTemplate

func StringsAsKeywords

func StringsAsKeywords() DynamicTemplate

type ESLogger

type ESLogger struct {
	Logger log15.Logger
}

func (*ESLogger) Printf

func (l *ESLogger) Printf(format string, v ...interface{})

type LongField

type LongField struct {
	Typ   string `json:"type"`
	Store bool   `json:"store"`
}

func NewLongField

func NewLongField() LongField

type Mappings

type Mappings struct {
	Mtyp MessageType `json:"syslogmsg"`
}

func NewMappings

func NewMappings() Mappings

type MessageFields

type MessageFields struct {
	Facility   StrField  `json:"facility"`
	Severity   StrField  `json:"severity"`
	Hostname   StrField  `json:"keyword"`
	Appname    StrField  `json:"appname"`
	Procid     StrField  `json:"procid"`
	Msgid      StrField  `json:"msgid"`
	Message    StrField  `json:"message"`
	Treported  DateField `json:"timereported"`
	Tgenerated DateField `json:"timegenerated"`
}

func NewMessageFields

func NewMessageFields() MessageFields

type MessageType

type MessageType struct {
	Properties       MessageFields                  `json:"properties"`
	DynamicTemplates [](map[string]DynamicTemplate) `json:"dynamic_templates"`
}

type Opts

type Opts struct {
	S Settings `json:"settings"`
	M Mappings `json:"mappings"`
}

func NewOpts

func NewOpts(shards uint, replicas uint, checkStartup bool, refreshInterval time.Duration) Opts

func (Opts) Marshal

func (o Opts) Marshal() string

type Settings

type Settings struct {
	Shards   uint          `json:"number_of_shards"`
	Replicas uint          `json:"number_of_replicas"`
	Shard    ShardSettings `json:"shard"`
	Refresh  string        `json:"refresh_interval"`
}

func NewSettings

func NewSettings(s uint, r uint, c bool, refr time.Duration) Settings

type ShardSettings

type ShardSettings struct {
	Check bool `json:"check_on_startup"`
}

type StrField

type StrField struct {
	Typ   string `json:"type"`
	Store bool   `json:"store"`
}

func NewKeyword

func NewKeyword() StrField

func NewTextField

func NewTextField() StrField

Jump to

Keyboard shortcuts

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