the function, between 0 and (global.nbthread-1). This is useful for logging
and debugging purposes.
+txn.id32 : integer
+ Returns the internal transaction ID. It is a 32bits integer. So, in absolute,
+ its value is not unique, transaction IDs may wrap. The wrapping period
+ depends on the request rate. In practice, it should not be an issue. For a
+ true unique ID, see "unique-id-format" directive.
+
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
| | | %[txn.conn_retries] | |
+---+------+------------------------------------------------------+---------+
| | %rt | request_counter (HTTP req or TCP session) | numeric |
+ | | | %[txn.id32] | |
+---+------+------------------------------------------------------+---------+
| | %s | server_name | string |
+---+------+------------------------------------------------------+---------+
return 1;
}
+static int smp_fetch_id32(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;
+ smp->data.u.sint = smp->strm->uniq_id;
+ return 1;
+}
+
/* Note: must not be declared <const> as its list will be overwritten.
* Please take care of keeping this list alphabetically sorted.
*/
{ "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.id32", smp_fetch_id32, 0, NULL, SMP_T_SINT, SMP_USE_INTRN, },
{ "txn.sess_term_state",smp_fetch_sess_term_state, 0, NULL, SMP_T_STR, SMP_USE_INTRN, },
{ NULL, NULL, 0, 0, 0 },
}};