Documentation
¶
Index ¶
- type Delimited
- func (d *Delimited) GetCsvOpts() []string
- func (d *Delimited) GetDescription() string
- func (d *Delimited) GetMapper() (mappers.Mapper[*types.DynamicRow], error)
- func (d *Delimited) GetName() string
- func (d *Delimited) GetProperties() map[string]string
- func (d *Delimited) GetRegex() (string, error)
- func (d *Delimited) Identifier() string
- func (d *Delimited) SetName(name string)
- func (d *Delimited) Validate() error
- type Format
- type FormatDescription
- type FormatDescriptionMap
- type PluginFormatWrapper
- func (w *PluginFormatWrapper) GetDescription() string
- func (w *PluginFormatWrapper) GetMapper() (mappers.Mapper[*types.DynamicRow], error)
- func (w *PluginFormatWrapper) GetName() string
- func (w *PluginFormatWrapper) GetProperties() map[string]string
- func (w *PluginFormatWrapper) GetRegex() (string, error)
- func (w *PluginFormatWrapper) Identifier() string
- func (w *PluginFormatWrapper) SetName(string)
- func (w *PluginFormatWrapper) SetPlugin(sourcePlugin *types.SourcePluginReattach) error
- func (w *PluginFormatWrapper) Validate() error
- type Regex
- func (r *Regex) GetDescription() string
- func (r *Regex) GetMapper() (mappers.Mapper[*types.DynamicRow], error)
- func (r *Regex) GetName() string
- func (r *Regex) GetProperties() map[string]string
- func (r *Regex) GetRegex() (string, error)
- func (r *Regex) Identifier() string
- func (r *Regex) SetName(name string)
- func (r *Regex) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delimited ¶
type Delimited struct {
Name string `hcl:",label"`
Description string `hcl:"description,optional"`
// Option to skip type detection for CSV parsing and assume all columns to be of type VARCHAR
AllVarchar *bool
// Option to allow the conversion of quoted values to NULL values
AllowQuotedNulls *bool
// The decimal separator of numbers.
DecimalSeparator *string
// Specifies the delimiter character that separates columns within each row (line) of the file.
Delimiter *string
// Specifies the string that should appear before a data character sequence that matches the quote value.
Escape *string
// Whether or not an extra filename column should be included in the result.
Filename *bool
// Do not match the specified columns' values against the NULL string.
// In the default case where the NULL string is empty,
// this means that empty values will be read as zero-length strings rather than NULLs.
ForceNotNull *[]string
// Specifies that the file contains a header line with the names of each column in the file.
Header *bool
// Option to ignore any parsing errors encountered – and instead ignore rows with errors.
IgnoreErrors *bool
// The maximum line size in bytes.
MaxLineSize *int
// Set the new line character(s) in the file. Options are '\r','\n', or '\r\n'.
// Note that the CSV parser only distinguishes between single-character and double-character line delimiters.
// Therefore, it does not differentiate between '\r' and '\n'.
NewLine *string
// Boolean value that specifies whether or not column names should be normalized,
// removing any non-alphanumeric characters from them.
NormalizeNames *bool
// If this option is enabled, when a row lacks columns, it will pad the remaining columns on the right with NULL values.
NullPadding *bool
// Specifies the string that represents a NULL value or (since v0.10.2) a list of strings that represent a NULL value.
NullStr *string
// Specifies the quoting string to be used when a data value is quoted.
Quote *string
// The number of sample rows for auto detection of parameters.
SampleSize *int
// Specifies the date format to use when parsing timestamps
TimestampFormat *string
}
func (*Delimited) GetCsvOpts ¶
GetCsvOpts converts the Delimited configuration into a slice of CSV options strings in the format expected by DuckDb read_csv function
func (*Delimited) GetDescription ¶
GetDescription returns the description of this format instance
func (*Delimited) GetProperties ¶
func (*Delimited) Identifier ¶
Identifier returns the format type identifier
type Format ¶
type Format interface {
parse.Config
GetName() string
SetName(name string)
GetMapper() (mappers.Mapper[*types.DynamicRow], error)
GetRegex() (string, error)
GetDescription() string
// GetProperties returns the format properties as a string map - used for introspection
GetProperties() map[string]string
}
func NewDelimited ¶
func NewDelimited() Format
func ParseFormat ¶
type FormatDescription ¶
type FormatDescription struct {
Type string
Name string
Description string
Regex string
Properties map[string]string
}
FormatDescription is a struct which contains introspection data about a format - it is used in the Describe call to pas format information
func FormatDescriptionFromProto ¶
func FormatDescriptionFromProto(pb *proto.FormatDescription) *FormatDescription
func (*FormatDescription) FullName ¶
func (f *FormatDescription) FullName() string
func (*FormatDescription) ToProto ¶
func (f *FormatDescription) ToProto() *proto.FormatDescription
type FormatDescriptionMap ¶
type FormatDescriptionMap map[string]*FormatDescription
func FormatMapFromProto ¶
func FormatMapFromProto(pb map[string]*proto.FormatDescription) FormatDescriptionMap
func (FormatDescriptionMap) ToProto ¶
func (f FormatDescriptionMap) ToProto() map[string]*proto.FormatDescription
type PluginFormatWrapper ¶
type PluginFormatWrapper struct {
// contains filtered or unexported fields
}
PluginFormatWrapper is an implementation of Format which wraps a GRPC plugin which implements the format
func NewPluginFormatWrapper ¶
func NewPluginFormatWrapper(formatData *types.FormatConfigData, sourcePlugin *types.SourcePluginReattach) (*PluginFormatWrapper, error)
NewPluginFormatWrapper creates a new PluginFormatWrapper
func (*PluginFormatWrapper) GetDescription ¶
func (w *PluginFormatWrapper) GetDescription() string
func (*PluginFormatWrapper) GetMapper ¶
func (w *PluginFormatWrapper) GetMapper() (mappers.Mapper[*types.DynamicRow], error)
func (*PluginFormatWrapper) GetName ¶
func (w *PluginFormatWrapper) GetName() string
func (*PluginFormatWrapper) GetProperties ¶
func (w *PluginFormatWrapper) GetProperties() map[string]string
func (*PluginFormatWrapper) GetRegex ¶
func (w *PluginFormatWrapper) GetRegex() (string, error)
func (*PluginFormatWrapper) Identifier ¶
func (w *PluginFormatWrapper) Identifier() string
func (*PluginFormatWrapper) SetName ¶
func (w *PluginFormatWrapper) SetName(string)
func (*PluginFormatWrapper) SetPlugin ¶
func (w *PluginFormatWrapper) SetPlugin(sourcePlugin *types.SourcePluginReattach) error
SetPlugin sets the plugin client for the source this is called from WithPluginReattach option
func (*PluginFormatWrapper) Validate ¶
func (w *PluginFormatWrapper) Validate() error
type Regex ¶
type Regex struct {
Name string `hcl:",label"`
Description string `hcl:"description,optional"`
// the layout of the log line
// NOTE that as will contain grok patterns, this property is included in constants.GrokConfigProperties
// meaning and '{' will be auto-escaped in the hcl
Layout string `hcl:"layout"`
}
func (*Regex) GetDescription ¶
func (*Regex) GetProperties ¶
func (*Regex) Identifier ¶
Identifier returns the format type identifier