Documentation
¶
Index ¶
- Variables
- 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 JsonLines
- func (d *JsonLines) GetDescription() string
- func (d *JsonLines) GetMapper() (mappers.Mapper[*types.DynamicRow], error)
- func (d *JsonLines) GetName() string
- func (d *JsonLines) GetProperties() map[string]string
- func (d *JsonLines) GetReadJsonOpts() []string
- func (d *JsonLines) GetRegex() (string, error)
- func (d *JsonLines) Identifier() string
- func (d *JsonLines) SetName(name string)
- func (d *JsonLines) 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 ¶
var DefaultDelimited = &Delimited{ Name: "default", Description: "Default Delimited format", Delimiter: utils.ToPointer(","), Header: utils.ToPointer(true), }
DefaultDelimited is the default Delimited format - this is exported by the core plugin
var DefaultJsonLines = &JsonLines{
Name: "default",
Description: "Default JSONL format",
}
DefaultJsonLines is the default JSONL format - this is exported by the core plugin
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 `hcl:"all_varchar,optional"`
// Option to allow the conversion of quoted values to NULL values
AllowQuotedNulls *bool `hcl:"allow_quoted_nulls,optional"`
// Character used to initiate comments.
// Lines starting with a comment character (optionally preceded by space characters) are completely ignored; other lines containi
Comment *string `hcl:"comment,optional"`
// Specifies the date format to use when parsing dates.
DateFormat *string `hcl:"date_format,optional"`
// The decimal separator of numbers.
DecimalSeparator *string `hcl:"decimal_separator,optional"`
// Specifies the delimiter character that separates columns within each row (line) of the file.
Delimiter *string `hcl:"delimiter,optional"`
// Specifies the string that should appear before a data character sequence that matches the quote value.
Escape *string `hcl:"escape,optional"`
// Whether or not an extra filename column should be included in the result.
Filename *bool `hcl:"filename,optional"`
// 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 `hcl:"force_not_null,optional"`
// Specifies that the file contains a header line with the names of each column in the file.
Header *bool `hcl:"header,optional"`
// Option to ignore any parsing errors encountered – and instead ignore rows with errors.
IgnoreErrors *bool `hcl:"ignore_errors,optional"`
// The maximum line size in bytes.
MaxLineSize *int `hcl:"max_line_size,optional"`
// 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 `hcl:"new_line,optional"`
// Boolean value that specifies whether or not column names should be normalized,
// removing any non-alphanumeric characters from them.
NormalizeNames *bool `hcl:"normalize_names,optional"`
// If this option is enabled, when a row lacks columns, it will pad the remaining columns on the right with NULL values.
NullPadding *bool `hcl:"null_padding,optional"`
// Specifies the string that represents a NULL value or (since v0.10.2) a list of strings that represent a NULL value.
NullStr *string `hcl:"null_str,optional"`
// Specifies the quoting string to be used when a data value is quoted.
Quote *string `hcl:"quote,optional"`
// The number of sample rows for auto detection of parameters.
SampleSize *int `hcl:"sample_size,optional"`
// Specifies the date format to use when parsing timestamps
TimestampFormat *string `hcl:"timestamp_format,optional"`
}
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 ¶
GetProperties returns the format as a string which can be included in the introspection response
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 NewJsonLines ¶ added in v0.3.0
func NewJsonLines() 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 JsonLines ¶ added in v0.3.0
type JsonLines struct {
Name string `hcl:",label"`
Description string `hcl:"description,optional"`
// Option to define number of sample objects for automatic JSON type detection.
// Set to -1 to scan the entire input file (if not provided, DuckDB defaults to 20480)
SampleSize *int `hcl:"sample_size,optional"`
// Specifies the date format to use when parsing timestamps.
// (If not provided, DuckDB defaults to the ISO 8601 format)
DateFormat *string `hcl:"date_format,optional"`
}
func (*JsonLines) GetDescription ¶ added in v0.3.0
GetDescription returns the description of this format instance
func (*JsonLines) GetProperties ¶ added in v0.3.0
func (*JsonLines) GetReadJsonOpts ¶ added in v0.3.0
GetReadJsonOpts converts the Delimited configuration into a slice of CSV options strings in the format expected by DuckDb read_csv function
func (*JsonLines) Identifier ¶ added in v0.3.0
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