the function, between 0 and (global.nbthread-1). This is useful for logging
and debugging purposes.
+txn.conn_retries : integer
+ Returns the the number of connection retries experienced by this session when
+ trying to connect to the server. This value is subject to change while the
+ connection is not fully established. For HTTP connections, the value may be
+ affected by L7 retries.
+
txn.sess_term_state : string
Retruns the TCP or HTTP session termination state, as reported in the log. It
is a 2-characters string, The final session state followed by the event which
| H | %r | http_request | string |
+---+------+------------------------------------------------------+---------+
| | %rc | retries | numeric |
+ | | | %[txn.conn_retries] | |
+---+------+------------------------------------------------------+---------+
| | %rt | request_counter (HTTP req or TCP session) | numeric |
+---+------+------------------------------------------------------+---------+
return 1;
}
+static int smp_fetch_conn_retries(const struct arg *args, struct sample *smp, const char *km, void *private)
+{
+ smp->flags = SMP_F_VOL_TXN;
+ smp->data.type = SMP_T_SINT;
+ if (!smp->strm)
+ return 0;
+
+ if (!sc_state_in(smp->strm->scb->state, SC_SB_DIS|SC_SB_CLO))
+ smp->flags |= SMP_F_VOL_TEST;
+ smp->data.u.sint = smp->strm->conn_retries;
+ return 1;
+}
+
/* Note: must not be declared <const> as its list will be overwritten.
* Please take care of keeping this list alphabetically sorted.
*/
{ "cur_tunnel_timeout", smp_fetch_cur_tunnel_timeout, 0, NULL, SMP_T_SINT, SMP_USE_BKEND, },
{ "last_rule_file", smp_fetch_last_rule_file, 0, NULL, SMP_T_STR, SMP_USE_INTRN, },
{ "last_rule_line", smp_fetch_last_rule_line, 0, NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "txn.conn_retries", smp_fetch_conn_retries, 0, NULL, SMP_T_SINT, SMP_USE_L4SRV, },
{ "txn.sess_term_state",smp_fetch_sess_term_state, 0, NULL, SMP_T_STR, SMP_USE_INTRN, },
{ NULL, NULL, 0, 0, 0 },
}};