示例#1
0
	// AWS EC2 Metadata Service
	ec2InstanceIdentityURI = "/2014-02-25/dynamic/instance-identity/document"

	// DigitalOcean Metadata Service
	doMetadataURI = "/metadata/v1.json"

	// Google GCE Metadata Service
	gceMetadataURI = "/computeMetadata/v1/?recursive=true&alt=json"
)

var debugf = logp.MakeDebug("filters")

var (
	ec2Schema = s.Schema{
		"instance_id":       c.Str("instanceId"),
		"machine_type":      c.Str("instanceType"),
		"region":            c.Str("region"),
		"availability_zone": c.Str("availabilityZone"),
	}.Apply

	doSchema = s.Schema{
		"instance_id": c.StrFromNum("droplet_id"),
		"region":      c.Str("region"),
	}.Apply

	gceHeaders = map[string]string{"Metadata-Flavor": "Google"}
	gceSchema  = func(m map[string]interface{}) common.MapStr {
		out := common.MapStr{}

		if instance, ok := m["instance"].(map[string]interface{}); ok {
示例#2
0
文件: data.go 项目: ChongFeng/beats
package status

import (
	s "github.com/elastic/beats/metricbeat/schema"
	c "github.com/elastic/beats/metricbeat/schema/mapstriface"
)

var schema = s.Schema{
	"version": c.Str("version"),
	"uptime": s.Object{
		"ms": c.Int("uptimeMillis"),
	},
	"local_time":         c.Time("localTime"),
	"write_backs_queued": c.Bool("writeBacksQueued"),
	"asserts": c.Dict("asserts", s.Schema{
		"regular":   c.Int("regular"),
		"warning":   c.Int("warning"),
		"msg":       c.Int("msg"),
		"user":      c.Int("user"),
		"rollovers": c.Int("rollovers"),
	}),
	"background_flushing": c.Dict("backgroundFlushing", s.Schema{
		"flushes": c.Int("flushes"),
		"total": s.Object{
			"ms": c.Int("total_ms"),
		},
		"average": s.Object{
			"ms": c.Int("average_ms"),
		},
		"last": s.Object{
			"ms": c.Int("last_ms"),