]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stick-table: add new converters to fetch table data
authorWilly Tarreau <w@1wt.eu>
Thu, 10 Jul 2014 12:03:38 +0000 (14:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 10 Jul 2014 14:43:44 +0000 (16:43 +0200)
commitd9f316ab83d12cbb871cb42a408fbf7366307db3
treeefd618270f357ef6aa3b666ea26a29ab407d1ba8
parent8fed9037cd5a680180fd9221568c95d9dfd03042
MEDIUM: stick-table: add new converters to fetch table data

These new converters make it possible to look up any sample expression
in a table, and check whether an equivalent key exists or not, and if it
exists, to retrieve the associated data (eg: gpc0, request rate, etc...).

Till now it was only possible using tracking, but sometimes tracking is
not suited to only retrieving such counters, either because it's done too
early or because too many items need to be checked without necessarily
being tracked.

These converters all take a string on input, and then convert it again to
the table's type. This means that if an input sample is of type IPv4 and
the table is of type IP, it will first be converted to a string, then back
to an IP address. This is a limitation of the current design which does not
allow converters to declare that "any" type is supported on input. Since
strings are the only types which can be cast to any other one, this method
always works.

The following converters were added :

  in_table, table_bytes_in_rate, table_bytes_out_rate, table_conn_cnt,
  table_conn_cur, table_conn_rate, table_gpc0, table_gpc0_rate,
  table_http_err_cnt, table_http_err_rate, table_http_req_cnt,
  table_http_req_rate, table_kbytes_in, table_kbytes_out,
  table_server_id, table_sess_cnt, table_sess_rate, table_trackers.
doc/configuration.txt
src/stick_table.c