-
Notifications
You must be signed in to change notification settings - Fork 6
/
types.go
99 lines (87 loc) · 3.02 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package seslog
import (
"time"
)
type Options struct {
CHDSN string `json:"clickhouse-dsn"`
Address string `json:"listen-addr"`
FlushInterval string `json:"flush-interval"`
}
type NginxEvent struct {
Nginx_ip string
Nginx_ip_uint32 uint32
Nginx_event_time time.Time
Nginx_hostname string
Nginx_tag string
}
type TimeZoneInfo struct {
Zonename string
Zoneoffset int32
}
type URLParsed struct {
Scheme string
Domain string
Path string
Arg_keys []string
Arg_vals [][]string
}
type ConnectionInfo struct {
Connections_active uint16 `field:"connections_active"`
Connections_reading uint16 `field:"connections_reading"`
Connections_waiting uint16 `field:"connections_waiting"`
Connections_writing uint16 `field:"connections_writing"`
}
type UserAgentInfo struct {
Ua_family string
Ua_major string
Ua_minor string
Ua_patch string
Ua_os_family string
Ua_os_major string
Ua_os_minor string
Ua_os_patch string
Ua_os_patchminor string
Ua_device_family string
}
type UpstreamInfo struct {
Upstream_response_length uint64 `field:"upstream_response_length"`
Upstream_response_time float64 `field:"upstream_response_time"`
Upstream_status uint16 `field:"upstream_status"`
}
type AccessLogEvent struct {
NginxEvent
TimeZoneInfo
ConnectionInfo
UpstreamInfo
UserAgentInfo
Url_parsed URLParsed
Referer_parsed URLParsed
Location_parsed URLParsed
Body_bytes_sent uint64 `field:"body_bytes_sent"`
Connections_active uint16 `field:"connections_active"`
Connections_reading uint16 `field:"connections_reading"`
Connections_waiting uint16 `field:"connections_waiting"`
Connections_writing uint16 `field:"connections_writing"`
Content_length uint64 `field:"content_length"`
Http_host string `field:"http_host"`
Http_referer string `field:"http_referer"`
Http_location string `field:"sent_http_location"`
Http_user_agent string `field:"http_user_agent"`
Http_x_forwarded_for string `field:"http_x_forwarded_for"`
Remote_addr string `field:"remote_addr"`
Request_method string `field:"request_method"`
Request_time float64 `field:"request_time"`
Request_uri string `field:"request_uri"`
Scheme string `field:"scheme"`
Status uint16 `field:"status"`
Tcpinfo_rtt uint64 `field:"tcpinfo_rtt"`
Tcpinfo_rttvar uint64 `field:"tcpinfo_rttvar"`
Time_local time.Time `field:"time_local"`
Upstream_cache_status string `field:"upstream_cache_status"`
Upstream_response_length uint64 `field:"upstream_response_length"`
Upstream_response_time float64 `field:"upstream_response_time"`
Upstream_status uint16 `field:"upstream_status"`
Uri string `field:"uri"`
Remote_addr_uint32 uint32
}
type AccessLogEvents []AccessLogEvent