How to use Synology as Log Management service for storing Artica Proxy web requests
Use the Synology in order to stores Internet access events.
Create a log receiver on your Synology server
On your Synology make sure the “Log center” feature is running and installed.
Click on the Open button

- Select the “Log receiving” section.
- Click on create button
- Type the name of the receiver
- Select BSD format
- Select UDP as transfert protocol.
- Type 514 as listen port.

A new receiver is added on your Synology server

Set Artica to send logs to your Synology using syslog
- On the Artica Web console, select “Logs Center” and “Legal Logs'”
- Turn on the “Activate this feature” under the Syslog section.
- Set your Synology server address in the Remote Server (local 6) field.
- Set the remote port to 514
- If you did not want to store requests locally, turn on the “Remove local events” option.
In the case, the “Requests” section on Artica will be removed from the Interface. - If you want to personalize events, turn on the “Use a personalized events” checkbox and define the pattern to send events.
- Finally, click on Apply button

Search events on your Synology
- On the Log center, click on the “Logs” section in the left menu.
- Choose the option “From other servers” in the drop-down list.
- You should see proxy requests in rows.

How to personalize events
The <format specification> is a string with embedded % format codes
% format codes all follow the same basic structure where all components but the format code are optional and usually unnecessary
especially when dealing with common codes.
% [encoding] [-] [[0]width] [{arg}] formatcode [{arg}]
Encoding escapes or otherwise protects "special" characters:
" Quoted string encoding where quote(") and backslash(\) characters are \-escaped while CR, LF, and TAB characters are encoded as \r, \n, and \t two-character sequences.
[ Custom proxy encoding where percent(%), square brackets([]), backslash(\) and characters with codes outside of [32,126] range are %-encoded.
# URL encoding (a.k.a. percent-encoding) where all URL unsafe and control characters (per RFC1738) are %-encoded.
/ Shell-like encoding where quote(") and backslash(\) characters are \-escaped while CR and LF characters are encoded as \r and \n two-character sequences. Values containing SP character(s) are surrounded by quotes(").
' Raw/as-is encoding with no escaping/quoting.
Default encoding: When no explicit encoding is specified, each %code determines its own encoding.
Most %codes use raw/as-is encoding, but some codes use a so called "pass-through URL encoding" where all URL unsafe and control characters (per RFC 1738) are %-encoded, but the percent character(%) is left as is.
- left aligned width minimum and/or maximum field width: [width_min][.width_max]
When minimum starts with 0, the field is zero-padded.
String values exceeding maximum width are truncated.
{arg} argument such as header name etc. This field may be placed before or after the token, but not both at once.
Format codes:
%A literal % charactersnUnique sequence number per log line entryerr_codeThe ID of an error response served by proxy or a similar internal error identifier.err_detailAdditional err_code-dependent error information.noteThe annotation specified by the argument. Also logs the adaptation meta headers set by the adaptation_meta configuration parameter.
If no argument given all annotations logged.
The argument may include a separator to use with annotation values:name[:separator]
By default, multiple note values are separated with "," and multiple notes are separated with "\r\n".
When logging named notes with %{name}note, the explicitly configured separator is used between note values.
When logging all notes with %note, the explicitly configured separator is used between individual notes.
There is currently no way to specify both value and notes separators when logging all notes with %note.
Connection related format codes:
>a: Client source IP addressA: Client FQDN>p: Client source port>eui: Client source EUI (MAC address, EUI-48 or EUI-64 identifier)>la: Local IP address the client connected to>lp: Local port number the client connected to>qos: Client connection TOS/DSCP value set by Proxy>nfmarkClient connection netfilter mark set by Proxyla: Local listening IP address the client connection was connected to.lp: Local listening port number the client connection was connected to.<a:Server IP address of the last server or peer connection<A: Server FQDN or peer name<p: Server port number of the last server or peer connection<la: Local IP address of the last server or peer connection<lp: Local port number of the last server or peer connection<qos: Server connection TOS/DSCP value set by Squid<nfmark: Server connection netfilter mark set by Squid>handshake: Raw client handshake;
Initial client bytes received by Squid on a newly accepted TCP connection or inside a just established CONNECT tunnel. Proxy stops accumulating handshake bytes as soon as the handshake parser succeeds or fails (determining whether the client is using the expected protocol).
For HTTP clients, the handshake is the request line.
For TLS clients, the handshake consists of all TLS records up to and including the TLS record that contains the last byte of the first ClientHello message. For clients using an unsupported protocol, this field contains the bytes received by Artica Proxy at the time of the handshake parsing failure.
Time related format codes:
ts: Seconds since epochtu: subsecond time (milliseconds)tl: Local time. Optional strftime format argument default %d/%b/%Y:%H:%M:%S %ztg:GMT time. Optional strftime format argument default %d/%b/%Y:%H:%M:%S %ztr:Response time (milliseconds)dt:Total time spent making DNS lookups (milliseconds)tS:Approximate master transaction start time in<full seconds since epoch>.<fractional seconds>format.
Currently, Artica Proxy considers the master transaction started when a complete HTTP request header initiating the transaction is received from the client.
This is the same value that Proxy uses to calculate transaction response time when logging%trto access.log. Currently, Artica Proxy uses millisecond resolution for%tSvalues, similar to the default access.log "current time" field (%ts.%03tu).
Access Control related format codes:
et:Tag returned by external aclea:Log string returned by external aclun:User name (any available)ul:User name from authenticationue:User name from external acl helperui:User name from identun:A user name. Expands to the first available name from the following list of information sources:
authenticated user name, like %ul
user name supplied by an external ACL, like %ue
SSL client name, like %us
ident user name, like %ui
credentials Client credentials.
The exact meaning depends on the authentication scheme: For Basic authentication it is the password; for Digest, the realm sent by the client; for NTLM and Negotiate, the client challenge or client credentials prefixed with "YR " or "KK ".
HTTP related format codes:
[http::]rm: Request method (GET/POST etc)[http::]>rm: Request method from client[http::]<rm: Request method sent to server or peer[http::]ru: Request URL received (or computed) and sanitized
Logs request URI received from the client, a request adaptation service, or a request redirector (whichever was applied last).
Computed URLs are URIs of internally generated requests and various "error:..." URIs.
This field is not encoded by default. Encodingthis field using variants of %-encoding will clash with uri_whitespace modifications that also use %-encoding.- [http::]>ru: Request URL received from the client (or computed). Computed URLs are URIs of internally generated requests and various "error:..." URIs.
Unlike %ru, this request URI is not affected by request adaptation, URL rewriting services, Honors uri_whitespace. [http::]<ru: Request URL sent to server or peer[http::]>rs: Request URL scheme from client[http::]<rs: Request URL scheme sent to server or peer[http::]>rd: Request URL domain from client[http::]<rd: Request URL domain sent to server or peer[http::]>rP: Request URL port from client[http::]<rP: Request URL port sent to server or peer[http::]rp: Request URL path excluding hostname[http::]>rp: Request URL path excluding hostname from client[http::]<rp: Request URL path excluding hostname sent to server or peer[http::]rv: Request protocol version[http::]>rv: Request protocol version from client[http::]<rv: Request protocol version sent to server or peer[http::]>h:Original received request header. Usually differs from the request header sent by proxy , although most fields are often preserved.
Accepts optional header field name/value filter argument using name[:[separator]element] format.[http::]>ha: Received request header after adaptation and redirection (pre-cache REQMOD vectoring point).
Usually differs from the request header sent by Proxy, although most fields are often preserved.
Optional header name argument as for >h[http::]<Hs:HTTP status code received from the next hop[http::]>Hs:HTTP status code sent to the client-
[http::]<h: Reply header. Optional header name argument as for >h [http::]mt: MIME content type
SIZE COUNTERS
[http::]st: Total size of request + reply traffic with client[http::]>st: Total size of request received from client.
Excluding chunked encoding bytes.[http::]<st: Total size of reply sent to client (after adaptation)[http::]>sh: Size of request headers received from client[http::]<sh: Size of reply headers sent to client (after adaptation)[http::]<sH: Reply high offset sent[http::]<sS: Upstream object size[http::]<bs: Number of HTTP-equivalent message body bytes received from the next hop, excluding chunked transfer encoding and control messages.
Generated FTP/Gopher listings are treated as received bodies.
TIMING
[http::]<pt: Peer response time in milliseconds. The timer starts when the last request byte is sent to the next hop and stops when the last response byte is received.
[http::]<tt: Total time in milliseconds. The timer starts with the first connect request (or write I/O) sent to the first selected peer. The timer stops with the last I/O with the last peer.