package logscan
import "zgo.at/goatcounter/v2/logscan"
Index ¶
- Constants
- type Line
- func (l Line) ContentType() string
- func (l Line) Datetime(scan *Scanner) (time.Time, error)
- func (l Line) HTTP() string
- func (l Line) Host() string
- func (l Line) Line() string
- func (l Line) LineNo() uint64
- func (l Line) Method() string
- func (l Line) Path() string
- func (l Line) Query() string
- func (l Line) Referrer() string
- func (l Line) RemoteAddr() string
- func (l Line) Size() int
- func (l Line) Status() int
- func (l Line) Timing() time.Duration
- func (l Line) UserAgent() string
- func (l Line) XForwardedFor() string
- type Scanner
- func New(in io.Reader, format, date, tyme, datetime string, exclude []string) (*Scanner, error)
- func NewFollow(ctx context.Context, file, format, date, tyme, datetime string, exclude []string) (*Scanner, error)
- func (s Scanner) DateFormats() (date, time, datetime string)
- func (s *Scanner) Line(ctx context.Context) (Line, error)
- func (s Scanner) MatchExcludes(line Line) bool
Constants ¶
const ( // Combined format; used by default in Apache, nginx. // // 127.0.0.1 user - [10/Oct/2000:13:55:36 -0700] "GET /path HTTP/1.1" 200 2326 "https://ref" "Mozilla/5.0" // $remote_addr $ignore [$datetime] "$method $path $http" $status $size "$referrer" "$user_agent" Combined = `$remote_addr $ignore [$datetime] "$method $path $http" $status $size "$referrer" "$user_agent"` CombinedVhost = `$host:` + Combined // Common log format. // // 127.0.0.1 user - [10/Oct/2000:13:55:36 -0700] "GET /path HTTP/1.1" 200 2326 // $remote_addr $ignore [$datetime] "$method $path $http" $status $size` Common = `$remote_addr $ignore [$datetime] "$method $path $http" $status $size` CommonVhost = `$host:` + Common )
Types ¶
type Line ¶
func (Line) ContentType ¶
func (Line) Datetime ¶
func (Line) HTTP ¶
func (Line) Host ¶
func (Line) Line ¶
func (Line) LineNo ¶
func (Line) Method ¶
func (Line) Path ¶
func (Line) Query ¶
func (Line) Referrer ¶
func (Line) RemoteAddr ¶
func (Line) Size ¶
func (Line) Status ¶
func (Line) Timing ¶
func (Line) UserAgent ¶
func (Line) XForwardedFor ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func New ¶
New processes all the lines in the reader.
func NewFollow ¶
func NewFollow(ctx context.Context, file, format, date, tyme, datetime string, exclude []string) (*Scanner, error)
NewFollow follows a file for new lines and processes them. Existing lines are not processed.
func (Scanner) DateFormats ¶
func (*Scanner) Line ¶
Line processes a single line.
func (Scanner) MatchExcludes ¶
Source Files ¶
logscan.go
- Version
- v2.5.0 (latest)
- Published
- Dec 14, 2023
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 1 day ago –
Tools for package owners.