Skip to content

andrewkroh/go-ecs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
}

About

Go library for querying ECS fields by name.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages