filtergeoip2

package
v0.0.0-...-7697303 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: LGPL-3.0 Imports: 5 Imported by: 0

README

gogstash geoip2 filter module

You need to download geoip2 database manually and setup file path in config.

Synopsis

filter:
  - type: geoip2
    # (required) geoip2 database file path, default: GeoLite2-City.mmdb
    db_path: "geoip2/database/file/path/GeoLite2-City.mmdb"
    # (required) ip address field to parse
    ip_field: remote_addr
    # (optional) parsed geoip info should saved to field, default: geoip
    key: geoip

Documentation

Index

Constants

View Source
const ErrorTag = "gogstash_filter_geoip2_error"

ErrorTag tag added to event when process geoip2 failed

View Source
const ModuleName = "geoip2"

ModuleName is the name used in config file

Variables

This section is empty.

Functions

func InitHandler

func InitHandler(ctx context.Context, raw *config.ConfigRaw) (config.TypeFilterConfig, error)

InitHandler initialize the filter plugin

Types

type FilterConfig

type FilterConfig struct {
	config.FilterConfig

	DBPath  string `json:"db_path"`  // geoip2 db file path, default: GeoLite2-City.mmdb
	IPField string `json:"ip_field"` // IP field to get geoip info
	Key     string `json:"key"`      // geoip destination field name, default: geoip
	// contains filtered or unexported fields
}

FilterConfig holds the configuration json fields and internal objects

func DefaultFilterConfig

func DefaultFilterConfig() FilterConfig

DefaultFilterConfig returns an FilterConfig struct with default values

func (*FilterConfig) Event

Event the main filter event

Jump to

Keyboard shortcuts

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