instead of "base" allows one to properly identify the target resource, for
statistics or caching use cases. See also "path", "pathq" and "base".
+
+bytes_in : integer
+ This returns the number of bytes uploaded from the client to the server.
+
+bytes_out integer
+ This is the number of bytes transmitted from the server to the client.
+
capture.req.hdr(<idx>) : string
This extracts the content of the header captured by the "capture request
header", idx is the position of the capture keyword in the configuration.
| Others |
+---+------+------------------------------------------------------+---------+
| | %B | bytes_read (from server to client) | numeric |
+ | | | %[bytes_out] | |
+---+------+------------------------------------------------------+---------+
| H | %CC | captured_request_cookie | string |
+---+------+------------------------------------------------------+---------+
| | %ST | status_code | numeric |
+---+------+------------------------------------------------------+---------+
| | %U | bytes_uploaded (from client to server) | numeric |
+ | | | %[bytes_in] | |
+---+------+------------------------------------------------------+---------+
| | %ac | actconn | |
| | | %[act_conn] | numeric |
return 0;
}
+/* bytes_{in,out} */
+static int smp_fetch_bytes(const struct arg *args, struct sample *smp, const char *kw, void *private)
+{
+ struct strm_logs *logs;
+
+ if (!smp->strm)
+ return 0;
+
+ smp->data.type = SMP_T_SINT;
+ smp->flags = 0;
+
+ logs = &smp->strm->logs;
+ if (!logs)
+ return 0;
+
+ if (kw[6] == 'i') { /* bytes_in */
+ smp->data.u.sint = logs->bytes_in;
+ } else { /* bytes_out */
+ smp->data.u.sint = logs->bytes_out;
+ }
+
+ return 1;
+}
static struct sample_fetch_kw_list smp_logs_kws = {ILH, {
+ { "bytes_in", smp_fetch_bytes, 0, NULL, SMP_T_SINT, SMP_USE_INTRN },
+ { "bytes_out", smp_fetch_bytes, 0, NULL, SMP_T_SINT, SMP_USE_INTRN },
+
{ "txn.timer.total", smp_fetch_txn_timers, 0, NULL, SMP_T_SINT, SMP_USE_TXFIN }, /* "Ta" */
{ "txn.timer.user", smp_fetch_txn_timers, 0, NULL, SMP_T_SINT, SMP_USE_TXFIN }, /* "Tu" */