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 Grok
- func (g *Grok) GetDescription() string
- func (g *Grok) GetMapper() (mappers.Mapper[*types.DynamicRow], error)
- func (g *Grok) GetName() string
- func (g *Grok) GetProperties() map[string]string
- func (g *Grok) GetRegex() (string, error)
- func (g *Grok) Identifier() string
- func (g *Grok) SetName(name string)
- func (g *Grok) 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 Grok ¶
type Grok 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"`
// grok patterns to add to the grok parser used to parse the layout
Patterns map[string]string `hcl:"patterns,optional"`
}
func (*Grok) GetDescription ¶
func (*Grok) GetProperties ¶
func (*Grok) Identifier ¶
Identifier returns the format type identifier
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
Click to show internal directories.
Click to hide internal directories.