@@ -11,7 +11,7 @@ import (
11
11
)
12
12
13
13
//raw record to test against as a fail-safe (incase the template drifts)
14
- var rawUTRecord = "request_id=c9948493-1ece-4d21-a2d1-f96a9feded3c @timestamp=1585844380.949 timing=1 result=TCP_MEM_HIT cid=- ccid=12345 status=200 request_size=1 response_size=66000 proto=http/2 method=GET url=http://localhost/something/1591294965428966000/something.jpg sid=18bb190b-6727-497a-af8b-f03287d14caf, aid=1591294965428966000 did=5e85df2043933dd053ebec6f cancel=- proxy_type=- stuff=things oneother=\" onething\" fid=- content_type=text/plain address=2605:6000:1714:56e:c98a:445c:febd:6baf country=US referrer=localhost cw=- ssl_version=TLSv1.2 ssl_cipher=ECDHE-RSA-AES256-GCM-SHA384 enc=- ua=Mozilla/5.0 (X11; CrOS x86_64 12239.92.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.136 Safari/537.36"
14
+ var rawUTRecord = "request_id=c9948493-1ece-4d21-a2d1-f96a9feded3c @timestamp=1585844380.949 timing=1 result=TCP_MEM_HIT cid=- ccid=12345 status=200 request_size=1 response_size=66000 proto=http/2 method=GET url=http://localhost/something/1591294965428966000/something.jpg sid=18bb190b-6727-497a-af8b-f03287d14caf, aid=1591294965428966000 did=5e85df2043933dd053ebec6f cancel=- proxy_type=- stuff=things oneother=\" onething\" fid=- content_type=text/plain address=2605:6000:1714:56e:c98a:445c:febd:6baf country=US referrer=localhost cw=- ssl_version=TLSv1.2 ssl_cipher=ECDHE-RSA-AES256-GCM-SHA384 enc=- efs=1 ua=Mozilla/5.0 (X11; CrOS x86_64 12239.92.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.136 Safari/537.36"
15
15
16
16
var utLineTemplateStr = "request_id={{.requestIDField}} " +
17
17
"@timestamp={{.atTimestampField}} " +
@@ -40,6 +40,7 @@ var utLineTemplateStr = "request_id={{.requestIDField}} " +
40
40
"ssl_version={{.sslVersionField}} " +
41
41
"ssl_cipher={{.sslCipherField}} " +
42
42
"enc={{.encField}} " +
43
+ "efs={{.efs}} " +
43
44
"ua={{.uaField}}"
44
45
45
46
var utLineTemplate = template .Must (template .New ("user_traffic" ).Parse (utLineTemplateStr ))
73
74
sslVersionField = "TLSv1.2"
74
75
sslCipherField = "ECDHE-RSA-AES256-GCM-SHA384"
75
76
encField = "-"
77
+ efs = "1"
76
78
)
77
79
78
80
func defaultValues () map [string ]string {
@@ -105,6 +107,7 @@ func defaultValues() map[string]string {
105
107
"sslVersionField" : sslVersionField ,
106
108
"sslCipherField" : sslCipherField ,
107
109
"encField" : encField ,
110
+ "efs" : efs ,
108
111
}
109
112
}
110
113
@@ -144,6 +147,7 @@ func TestParseUserTrafficPayload(t *testing.T) {
144
147
SSLVersion : "TLSv1.2" ,
145
148
ENC : "-" ,
146
149
CW : "-" ,
150
+ EFS : 1 ,
147
151
UserAgent : "Mozilla/5.0 (X11; CrOS x86_64 12239.92.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.136 Safari/537.36" ,
148
152
Unparsed : []string {"stuff=things" , "oneother=\" onething\" " },
149
153
}
0 commit comments