insertutils

package
v0.20.0-victorialogs Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxLineSizeBytes is the maximum length of a single line for /insert/* handlers
	MaxLineSizeBytes = flagutil.NewBytes("insert.maxLineSizeBytes", 256*1024, "The maximum size of a single line, which can be read by /insert/* handlers")

	// MaxFieldsPerLine is the maximum number of fields per line for /insert/* handlers
	MaxFieldsPerLine = flag.Int("insert.maxFieldsPerLine", 1000, "The maximum number of log fields per line, which can be read by /insert/* handlers")
)

Functions

func ExtractTimestampISO8601FromFields

func ExtractTimestampISO8601FromFields(timeField string, fields []logstorage.Field) (int64, error)

ExtractTimestampISO8601FromFields extracts ISO8601 timestamp in nanoseconds from the field with the name timeField at fields.

The value for the timeField is set to empty string after returning from the function, so it could be ignored during data ingestion.

The current timestamp is returned if fields do not contain a field with timeField name or if the timeField value is empty.

Types

type CommonParams

type CommonParams struct {
	TenantID     logstorage.TenantID
	TimeField    string
	MsgField     string
	StreamFields []string
	IgnoreFields []string

	Debug           bool
	DebugRequestURI string
	DebugRemoteAddr string
}

CommonParams contains common HTTP parameters used by log ingestion APIs.

See https://docs.victoriametrics.com/victorialogs/data-ingestion/#http-parameters

func GetCommonParams

func GetCommonParams(r *http.Request) (*CommonParams, error)

GetCommonParams returns CommonParams from r.

func GetCommonParamsForSyslog added in v1.97.7

func GetCommonParamsForSyslog(tenantID logstorage.TenantID) *CommonParams

GetCommonParamsForSyslog returns common params needed for parsing syslog messages and storing them to the given tenantID.

func (*CommonParams) GetProcessLogMessageFunc

func (cp *CommonParams) GetProcessLogMessageFunc(lr *logstorage.LogRows) func(timestamp int64, fields []logstorage.Field)

GetProcessLogMessageFunc returns a function, which adds parsed log messages to lr.

Jump to

Keyboard shortcuts

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