Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent
Commits
6c6fab17
Commit
6c6fab17
authored
Dec 12, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test that client and backend log outputs are equivalent to varnishncsa
parent
0106b225
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
backend_client.conf
src/test/backend_client.conf
+8
-0
ncsa.sh
src/test/ncsa.sh
+19
-1
No files found.
src/test/backend_client.conf
0 → 100644
View file @
6c6fab17
# varnishevent test configuration for backend and client logging
# test for equivalence with varnishncsa
bformat
=%
b
%
H
%
h
%
I
%{
Host
}
i
%{
User
-
Agent
}
i
%{
X
-
Forwarded
-
For
}
i
%{
Accept
-
Ranges
}
o
%{
Connection
}
o
%{
Content
-
Encoding
}
o
%{
Content
-
Length
}
o
%{
Content
-
Type
}
o
%{
Date
}
o
%{
Last
-
Modified
}
o
%{
ETag
}
o
%{
Server
}
o
%
l
%
m
%
O
%
q
%
r
%
s
%
t
%{%
F
-%
T
}
t
%
U
%
u
%{
Varnish
:
time_firstbyte
}
x
%{
VSL
:
Begin
}
x
%{
VSL
:
End
}
x
%{
VSL
:
Link
}
x
%{
VSL
:
Timestamp
}
x
%{
Varnish
:
vxid
}
x
%{
Varnish
:
side
}
x
cformat
=%
b
%
H
%
h
%
I
%{
Host
}
i
%{
User
-
Agent
}
i
%{
X
-
Forwarded
-
For
}
i
%{
Accept
-
Ranges
}
o
%{
Connection
}
o
%{
Content
-
Encoding
}
o
%{
Content
-
Length
}
o
%{
Content
-
Type
}
o
%{
Date
}
o
%{
Last
-
Modified
}
o
%{
ETag
}
o
%{
Server
}
o
%
l
%
m
%
O
%
q
%
r
%
s
%
t
%{%
F
-%
T
}
t
%
U
%
u
%{
Varnish
:
time_firstbyte
}
x
%{
VSL
:
Begin
}
x
%{
VSL
:
End
}
x
%{
VSL
:
Link
}
x
%{
VSL
:
Timestamp
}
x
%{
Varnish
:
vxid
}
x
%{
Varnish
:
side
}
x
monitor
.
interval
=
0
log
.
file
= /
dev
/
null
src/test/ncsa.sh
View file @
6c6fab17
...
...
@@ -45,7 +45,7 @@ fi
FORMAT
=
'%b %H %h %I %{Host}i %{Connection}i %{User-Agent}i %{X-Forwarded-For}i %{Accept-Ranges}o %{Age}o %{Connection}o %{Content-Encoding}o %{Content-Length}o %{Content-Type}o %{Date}o %{Last-Modified}o %{Server}o %{Transfer-Encoding}o %{Via}o %{X-Varnish}o %l %m %O %q %r %s %t %{%F-%T}t %U %u %{Varnish:time_firstbyte}x %{Varnish:hitmiss}x %{Varnish:handling}x %{VSL:Begin}x %{VSL:Debug}x %{VSL:End}x %{VSL:Gzip}x %{VSL:Hit}x %{VSL:Length}x %{VSL:Link}x %{VSL:ReqAcct}x %{VSL:ReqStart}x %{VSL:RespProtocol}x %{VSL:ReqMethod}x %{VSL:ReqURL}x %{VSL:ReqProtocol}x %{VSL:RespReason}x %{VSL:RespStatus}x %{VSL:Timestamp}x %{Varnish:vxid}x %{Varnish:side}x'
echo
"... custom -F format"
$EVENT
-r
$INPUT
-F
"
$FORMAT
"
-v
|
sed
's/-//g'
>
$EVENT_LOG
$EVENT
-r
$INPUT
-F
"
$FORMAT
"
|
sed
's/-//g'
>
$EVENT_LOG
$NCSA
-r
$INPUT
-F
"
$FORMAT
"
|
sed
's/-//g'
>
$NCSA_LOG
$DIFF_CMD
...
...
@@ -58,6 +58,24 @@ if [ "$RC" -ne "0" ]; then
exit
1
fi
FORMAT
=
'%b %H %h %I %{Host}i %{User-Agent}i %{X-Forwarded-For}i %{Accept-Ranges}o %{Connection}o %{Content-Encoding}o %{Content-Length}o %{Content-Type}o %{Date}o %{Last-Modified}o %{ETag}o %{Server}o %l %m %O %q %r %s %t %{%F-%T}t %U %u %{Varnish:time_firstbyte}x %{VSL:Begin}x %{VSL:End}x %{VSL:Link}x %{VSL:Timestamp}x %{Varnish:vxid}x %{Varnish:side}x'
# Skip the first line of varnishevent output ("Reading config file ...")
# Remove \" escaping from varnishncsa output (done for ETag)
echo
"... client and backend logging"
$EVENT
-r
$INPUT
-f
backend_client.conf |
tail
-n
+2 |
sed
's/-//g'
>
$EVENT_LOG
$NCSA
-r
$INPUT
-F
"
$FORMAT
"
-b
-c
|
sed
's/-//g; s/\\"/"/g'
>
$NCSA_LOG
$DIFF_CMD
RC
=
$?
rm
$EVENT_LOG
rm
$NCSA_LOG
if
[
"
$RC
"
-ne
"0"
]
;
then
echo
"ERROR: varnishevent/varnishncsa backend and client logs differ"
exit
1
fi
FORMAT_EVENT
=
'%{VSL:Timestamp[1]}x'
FORMAT_NCSA
=
'%{VSL:Timestamp[2]}x'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment