# transforms.conf

##############
# nmon metrics
##############

# host Meta overridden with 5th column
[nmon_metrics_csv_hostoverride]
DEST_KEY = MetaData:Host
REGEX = ^\d*,\"{0,1}[^\"\,]*\"{0,1},\"{0,1}[^\"\,]*\"{0,1}[^\"\,]*\"{0,1},\"{0,1}[^\"\,]*\"{0,1},\"{0,1}([^\"\,]*)\"{0,1}
FORMAT = host::$1

# Metrics sent over http - host
[nmon_metrics_http_host]
DEST_KEY = MetaData:Host
REGEX = hostname=\"([^\"]*)\"
FORMAT = host::$1

# Metrics sent over http - metric_name
[nmon_metrics_http_metric_name]
REGEX = metric_name=\"([^\"]*)\"
FORMAT = metric_name::$1
WRITE_META = true

[nmon_metrics_http_metric_value]
REGEX = _value=\"([\d|\.]*)\"
FORMAT = _value::$1
WRITE_META = true

# Metrics sent over http - dimensions
[nmon_metrics_http_dims]
REGEX = (dimension\_\w*)=\"([^\"]*)\"
FORMAT = $1::$2
WRITE_META = true

# Metrics sent over http - OStype
[nmon_metrics_http_OStype]
REGEX = OStype=\"([^\"]*)\"
FORMAT = OStype::$1
WRITE_META = true

# Metrics sent over http - serialnum
[nmon_metrics_http_serialnum]
REGEX = serialnum=\"([^\"]*)\"
FORMAT = serialnum::$1
WRITE_META = true

###########
# nmon data
###########

# Host override based on event data form nmon_data sourcetype

[nmon_data_hostoverride]
DEST_KEY = MetaData:Host
REGEX = ^\"{0,1}[a-zA-Z0-9\_]+\"{0,1},\"{0,1}[a-zA-Z0-9\-\_\.]+\"{0,1},\"{0,1}([a-zA-Z0-9\-\_\.]+)\"{0,1},.+
FORMAT = host::$1

# nmon data as events sent over http - host indexed field
[nmon_data_http_host]
DEST_KEY = MetaData:Host
REGEX = hostname=\"([^\"]*)\"
FORMAT = host::$1

# nmon data as events sent over http - OStype indexed field
[nmon_data_http_OStype]
REGEX = \sOStype=\"([^\"]*)\"
WRITE_META = true
FORMAT = OStype::$1
DEFAULT_VALUE = NULL

# nmon data as events sent over http - type indexed field
[nmon_data_http_type]
REGEX = \stype=\"([^\"]*)\"
WRITE_META = true
FORMAT = type::$1
DEFAULT_VALUE = NULL

# nmon data as events sent over http - rewrite sourcetype
[nmon_data_http_sourcetype]
DEST_KEY = MetaData:Sourcetype
REGEX = .*
FORMAT = sourcetype::nmon_data

#############
# nmon config
#############

# Host override based on event data form nmon_config sourcetype

[nmon_config_hostoverride]
DEST_KEY = MetaData:Host
REGEX = CONFIG\,[a-zA-Z0-9\-\:\.]+\,([a-zA-Z0-9\-\_\.]+)\,[a-zA-Z0-9\-\_\.]+
FORMAT = host::$1

# nmon_config sent over http

[nmon_config_http_rewrite_host]
DEST_KEY = MetaData:Host
REGEX = host=\"{0,}([a-zA-Z0-9\-\_\.]+)\"{0,}
FORMAT = host::$1

# nmon_config source
[nmon_config_http_rewrite_source]
DEST_KEY = MetaData:Source
REGEX = .*
FORMAT = source::configdata:http

# nmon_config sourcetype
[nmon_config_http_rewrite_sourcetype]
DEST_KEY = MetaData:Sourcetype
REGEX = .*
FORMAT = sourcetype::nmon_config
