timestamp

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParseResult

type ParseResult struct {
	Timestamp time.Time
	Found     bool
	Remaining string // Text with timestamp removed (for log message extraction)
}

ParseResult contains the parsed timestamp and remaining text

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles timestamp detection and parsing from log lines

func NewParser

func NewParser() *Parser

NewParser creates a new timestamp parser

func (*Parser) ExtractLogMessage

func (p *Parser) ExtractLogMessage(line string) string

ExtractLogMessage extracts the log message from a full log line by removing timestamp and severity

func (*Parser) ParseFromText

func (p *Parser) ParseFromText(text string) ParseResult

ParseFromText extracts and parses the first timestamp found in text

func (*Parser) ParseTimestamp

func (p *Parser) ParseTimestamp(value any) (time.Time, bool)

ParseTimestamp attempts to parse a timestamp from various string and numeric formats

func (*Parser) ParseTimestampToNano

func (p *Parser) ParseTimestampToNano(value any) (uint64, bool)

ParseTimestampToNano parses timestamp and returns nanoseconds (for OTLP compatibility)

Jump to

Keyboard shortcuts

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