Last active
December 17, 2015 18:49
-
-
Save namedgraph/5656373 to your computer and use it in GitHub Desktop.
Tomcat AccessLogValve pattern producing HTTP access logs in RDF Turtle format using HTTP Vocabulary. Configured in server.xml.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='utf-8'?> | |
<Server port="8005" shutdown="SHUTDOWN"> | |
<Service name="Catalina"> | |
<Engine name="Catalina" defaultHost="localhost"> | |
<Host name="localhost" appBase="webapps" | |
unpackWARs="true" autoDeploy="true"> | |
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" | |
prefix="localhost_access_log." suffix=".ttl" | |
pattern="[ a <http://www.w3.org/2011/http#Connection> ; <http://semantic-web.dk/ontologies/http#remoteAuthority> "%a" ; <http://www.w3.org/2011/http#connectionAuthority> "%v:%p" ; <http://www.w3.org/2011/http#requests> ([ a <http://www.w3.org/2011/http#Request> ; <http://purl.org/dc/terms/date> "%{yyyy-MM-dd}tT%{HH:mm:ss}t"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; <http://www.w3.org/2011/http#methodName> "%m" ; <http://www.w3.org/2011/http#mthd> <http://www.w3.org/2011/http-methods#%m> ; <http://www.w3.org/2011/http#absolutePath> "%U" ; <http://www.w3.org/2011/http#absoluteURI> "http://%v:%p%U%q" ; <http://www.w3.org/2011/http#headers> ([ a <http://www.w3.org/2011/http#RequestHeader> ; <http://www.w3.org/2011/http#fieldName> "Referer" ; <http://www.w3.org/2011/http#fieldValue> "%{Referer}i" ; <http://www.w3.org/2011/http#hdrName> <http://www.w3.org/2011/http-headers#referer> ] [ a <http://www.w3.org/2011/http#RequestHeader> ; <http://www.w3.org/2011/http#fieldName> "User-Agent" ; <http://www.w3.org/2011/http#fieldValue> "%{User-Agent}i" ; <http://www.w3.org/2011/http#hdrName> <http://www.w3.org/2011/http-headers#user-agent> ]) ; <http://www.w3.org/2011/http#resp> [ a <http://www.w3.org/2011/http#Response> ; <http://www.w3.org/2011/http#statusCodeNumber> "%s"^^<http://www.w3.org/2001/XMLSchema#int> ] ]) ] ." /> | |
</Host> | |
</Engine> | |
</Service> | |
</Server> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If your Tomcat is behind a proxy (such as Varnish cache), try
%{X-Forwarded-For}i
instead of%a
to get the original remote address.