Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 747 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 747 Bytes

go-ecs

go-ecs is a library for querying ECS fields by name to obtain the fields definition (e.g. Elasticsearch field data type, description, etc).

The library includes data from tagged released of elastic/ecs.

Install

go get github.com/andrewkroh/go-ecs@main

Usage

package main

import (
	"fmt"

	"github.com/andrewkroh/go-ecs"
)

func main() {
	field, err := ecs.Lookup("host.os.name", "8.10")
	if err != nil {
		return err
	}

	fmt.Println("data_type", field.DataType)
	fmt.Println("is array", field.Array)
	fmt.Println("pattern", field.Pattern)
	fmt.Println("description", field.Description)
}