On Mon, 14 Dec 2015 11:49:17 -0800
Hugues Alary <[email protected]> wrote:

> Hi Thierry,
> 
> Here's my haproxy -v: HA-Proxy version 1.6.2 2015/11/03
> 
> Using req_get_headers() worked, but interestingly enough, it doesn't show
> in the txn structure.


Hi,

The Lua object are a little bit complicated. Some component of the
object are accessible in direct, and other one via the metatable.

METATABLE is a special table which allow dynamic members and
inheritance.

Entry "[0]", is the attached C struct (HAProxy convention).

Other entries are "specific" to the object. I mean, that the other
entry were not inherited from the class, but were attached to the
object when it is created.

Between these other entries, we found th entry "http". In the "__index"
of the metatable of this entry, we found "req_get_headers()".

Ok, its not easy ;)

I try to explain the object format in the link below. Its a short
explaination.

   http://www.arpalert.org/haproxy-lua.html#h208

Thierry
   


> And here's the dump:
> 
> (table) HAProxy class TXN [
>     METATABLE: (table) table: 0xf8fe70 [
>         "__index": (table) table: 0xf80650 [
>             "deflog": (function) function: 0x4a58b0
>             "log": (function) function: 0x4a5e10
>             "Warning": (function) function: 0x4a5a80
>             "done": (function) function: 0x4a3c40
>             "get_priv": (function) function: 0x4a2490
>             "Debug": (function) function: 0x4a5530
>             "Info": (function) function: 0x4a56f0
>             "Alert": (function) function: 0x4a5370
>             "set_var": (function) function: 0x4a3600
>             "set_priv": (function) function: 0x4a3440
>             "set_tos": (function) function: 0x4a3110
>             "set_mark": (function) function: 0x4a3050
>             "get_var": (function) function: 0x4a3780
>             "set_loglevel": (function) function: 0x4a2cb0
>         ]
>         "__tostring": (function) function: 0xf805e0
>     ]
>     0: (userdata) userdata: 0x10c7c98
>     "sc": (table) HAProxy class Converters [
>         METATABLE: (table) table: 0xf7c400 [
>             "__index": (table) table: 0xf7c4b0 [
>                 "table_sess_rate": (function) function: 0xf85920
>                 "hex": (function) function: 0xf86410
>                 "djb2": (function) function: 0xf86640
>                 "http_date": (function) function: 0xf85a00
>                 "table_conn_rate": (function) function: 0xf80a10
>                 "capture_req": (function) function: 0xf85ae0
>                 "table_http_req_rate": (function) function: 0xf85bf0
>                 "table_conn_cnt": (function) function: 0xf85680
>                 "table_server_id": (function) function: 0xf85d50
>                 "table_gpt0": (function) function: 0xf85620
>                 "table_bytes_in_rate": (function) function: 0xf808d0
>                 "table_kbytes_out": (function) function: 0xf85ce0
>                 "table_trackers": (function) function: 0xf85990
>                 "table_sess_cnt": (function) function: 0xf85dc0
>                 "neg": (function) function: 0xf86150
>                 "even": (function) function: 0xf860e0
>                 "language": (function) function: 0xf85a70
>                 "odd": (function) function: 0xf86070
>                 "table_http_err_rate": (function) function: 0xf857f0
>                 "capture_res": (function) function: 0xf86240
>                 "bool": (function) function: 0xf85fc0
>                 "base64": (function) function: 0xf86320
>                 "table_http_err_cnt": (function) function: 0xf85770
>                 "bytes": (function) function: 0xf85f10
>                 "ipmask": (function) function: 0xf86480
>                 "cpl": (function) function: 0xf85f80
>                 "sdbm": (function) function: 0xf85e30
>                 "crc32": (function) function: 0xf865d0
>                 "utime": (function) function: 0xf86560
>                 "table_gpc0_rate": (function) function: 0xf858e0
>                 "lower": (function) function: 0xf863a0
>                 "table_kbytes_in": (function) function: 0xf85c60
>                 "table_bytes_out_rate": (function) function: 0xf809a0
>                 "ltime": (function) function: 0xf864f0
>                 "in_table": (function) function: 0xf80820
>                 "not": (function) function: 0xf86000
>                 "wt6": (function) function: 0xf85ea0
>                 "url_dec": (function) function: 0xf862b0
>                 "table_conn_cur": (function) function: 0xf856f0
>                 "table_http_req_cnt": (function) function: 0xf85b70
>                 "table_gpc0": (function) function: 0xf85870
>                 "upper": (function) function: 0xf86360
>             ]
>             "__tostring": (function) function: 0xf7c440
>         ]
>         0: (userdata) userdata: 0x10b91d8
>     ]
>     "req": (table) HAProxy class Channel [
>         METATABLE: (table) table: 0xf7c170 [
>             "__index": (table) table: 0xf7c1f0 [
>                 "set": (function) function: 0x4a2d30
>                 "send": (function) function: 0x4a22c0
>                 "get_out_len": (function) function: 0x4a23f0
>                 "forward": (function) function: 0x4a33e0
>                 "dup": (function) function: 0x4a23a0
>                 "getline": (function) function: 0x4a2350
>                 "get_in_len": (function) function: 0x4a2440
>                 "get": (function) function: 0x4a2300
>                 "append": (function) function: 0x4a3850
>             ]
>             "__tostring": (function) function: 0xf7c1b0
>         ]
>         0: (userdata) userdata: 0x1043380
>     ]
>     "c": (table) HAProxy class Converters [
>         METATABLE: (table) table: 0xf7c400 [
>             "__index": (table) table: 0xf7c4b0 [
>                 "table_sess_rate": (function) function: 0xf85920
>                 "hex": (function) function: 0xf86410
>                 "djb2": (function) function: 0xf86640
>                 "http_date": (function) function: 0xf85a00
>                 "table_conn_rate": (function) function: 0xf80a10
>                 "capture_req": (function) function: 0xf85ae0
>                 "table_http_req_rate": (function) function: 0xf85bf0
>                 "table_conn_cnt": (function) function: 0xf85680
>                 "table_server_id": (function) function: 0xf85d50
>                 "table_gpt0": (function) function: 0xf85620
>                 "table_bytes_in_rate": (function) function: 0xf808d0
>                 "table_kbytes_out": (function) function: 0xf85ce0
>                 "table_trackers": (function) function: 0xf85990
>                 "table_sess_cnt": (function) function: 0xf85dc0
>                 "neg": (function) function: 0xf86150
>                 "even": (function) function: 0xf860e0
>                 "language": (function) function: 0xf85a70
>                 "odd": (function) function: 0xf86070
>                 "table_http_err_rate": (function) function: 0xf857f0
>                 "capture_res": (function) function: 0xf86240
>                 "bool": (function) function: 0xf85fc0
>                 "base64": (function) function: 0xf86320
>                 "table_http_err_cnt": (function) function: 0xf85770
>                 "bytes": (function) function: 0xf85f10
>                 "ipmask": (function) function: 0xf86480
>                 "cpl": (function) function: 0xf85f80
>                 "sdbm": (function) function: 0xf85e30
>                 "crc32": (function) function: 0xf865d0
>                 "utime": (function) function: 0xf86560
>                 "table_gpc0_rate": (function) function: 0xf858e0
>                 "lower": (function) function: 0xf863a0
>                 "table_kbytes_in": (function) function: 0xf85c60
>                 "table_bytes_out_rate": (function) function: 0xf809a0
>                 "ltime": (function) function: 0xf864f0
>                 "in_table": (function) function: 0xf80820
>                 "not": (function) function: 0xf86000
>                 "wt6": (function) function: 0xf85ea0
>                 "url_dec": (function) function: 0xf862b0
>                 "table_conn_cur": (function) function: 0xf856f0
>                 "table_http_req_cnt": (function) function: 0xf85b70
>                 "table_gpc0": (function) function: 0xf85870
>                 "upper": (function) function: 0xf86360
>             ]
>             "__tostring": (function) function: 0xf7c440
>         ]
>         0: (userdata) userdata: 0x10b1538
>     ]
>     "res": (table) HAProxy class Channel [
>         METATABLE: (table) table: 0xf7c170 [
>             "__index": (table) table: 0xf7c1f0 [
>                 "set": (function) function: 0x4a2d30
>                 "send": (function) function: 0x4a22c0
>                 "get_out_len": (function) function: 0x4a23f0
>                 "forward": (function) function: 0x4a33e0
>                 "dup": (function) function: 0x4a23a0
>                 "getline": (function) function: 0x4a2350
>                 "get_in_len": (function) function: 0x4a2440
>                 "get": (function) function: 0x4a2300
>                 "append": (function) function: 0x4a3850
>             ]
>             "__tostring": (function) function: 0xf7c1b0
>         ]
>         0: (userdata) userdata: 0x10433c0
>     ]
>     "http": (table) HAProxy class HTTP [
>         METATABLE: (table) table: 0xf86e90 [
>             "__index": (table) table: 0xf86f10 [
>                 "req_set_uri": (function) function: 0x4a0e10
>                 "req_set_header": (function) function: 0x4a4b50
>                 "res_rep_header": (function) function: 0x4a47c0
>                 "req_set_method": (function) function: 0x4a0c10
>                 "req_rep_value": (function) function: 0x4a2590
>                 "req_set_path": (function) function: 0x4a0c90
>                 "res_rep_value": (function) function: 0x4a4690
>                 "req_add_header": (function) function: 0x4a48f0
>                 "req_del_header": (function) function: 0x4a3e20
>                 "req_rep_header": (function) function: 0x4a4560
>                 "res_set_header": (function) function: 0x4a2e20
>                 "res_add_header": (function) function: 0x4a4a20
>                 "req_set_query": (function) function: 0x4a0d20
>                 "req_get_headers": (function) function: 0x4a24f0
>                 "res_set_status": (function) function: 0x4a0ea0
>                 "res_del_header": (function) function: 0x4a3f10
>                 "res_get_headers": (function) function: 0x4a2540
>             ]
>             "__tostring": (function) function: 0xf86ed0
>         ]
>         0: (userdata) userdata: 0x10c7ea8
>     ]
>     "f": (table) HAProxy class Fetches [
>         METATABLE: (table) table: 0xf7c590 [
>             "__index": (table) table: 0xf7bbe0 [
>                 "sc1_http_err_cnt": (function) function: 0xf83510
>                 "nbsrv": (function) function: 0xf82530
>                 "ssl_fc_has_crt": (function) function: 0xf80190
>                 "sc_conn_cur": (function) function: 0xf84560
>                 "date": (function) function: 0xf882b0
>                 "src_sess_rate": (function) function: 0xf87fc0
>                 "req_len": (function) function: 0xf88b00
>                 "sc1_kbytes_out": (function) function: 0xf837e0
>                 "sc2_conn_cnt": (function) function: 0xf83b80
>                 "sc0_kbytes_out": (function) function: 0xf85370
>                 "be_conn": (function) function: 0xf82370
>                 "sc1_http_req_rate": (function) function: 0xf83690
>                 "ssl_fc_session_id": (function) function: 0xf804e0
>                 "req_body": (function) function: 0xf81e30
>                 "src_http_err_rate": (function) function: 0xf87c90
>                 "sc0_bytes_out_rate": (function) function: 0xf84d10
>                 "sc0_get_gpt0": (function) function: 0xf84f40
>                 "sc_conn_rate": (function) function: 0xf845d0
>                 "dst_conn": (function) function: 0xf7bc50
>                 "sc2_kbytes_out": (function) function: 0xf84100
>                 "sc1_tracked": (function) function: 0xf83930
>                 "res_payload_lv": (function) function: 0xf88fc0
>                 "always_false": (function) function: 0xf88190
>                 "sc1_http_req_cnt": (function) function: 0xf83610
>                 "ssl_f_s_dn": (function) function: 0xf7fe70
>                 "res_hdr": (function) function: 0xf82b80
>                 "ssl_c_key_alg": (function) function: 0xf896b0
>                 "sc1_bytes_out_rate": (function) function: 0xf83180
>                 "sc0_http_req_rate": (function) function: 0xf85220
>                 "sc_get_gpc0": (function) function: 0xf846b0
>                 "avg_queue": (function) function: 0xf82300
>                 "ssl_fc_cipher": (function) function: 0xf80120
>                 "sc0_bytes_in_rate": (function) function: 0xf84c90
>                 "base32_src": (function) function: 0xf810c0
>                 "ssl_fc_alg_keysize": (function) function: 0xf800b0
>                 "str": (function) function: 0xf884b0
>                 "hdr": (function) function: 0xf811e0
>                 "ssl_fc": (function) function: 0xf80030
>                 "req_proto_http": (function) function: 0xf81d10
>                 "ssl_fc_sni": (function) function: 0xf80550
>                 "req_payload_lv": (function) function: 0xf88be0
>                 "req_hdr_cnt": (function) function: 0xf82790
>                 "src_gpc0_rate": (function) function: 0xf87b90
>                 "sc1_sess_rate": (function) function: 0xf838c0
>                 "ipv6": (function) function: 0xf885d0
>                 "cook": (function) function: 0xf81500
>                 "sc_inc_gpc0": (function) function: 0xf84970
>                 "sc2_get_gpt0": (function) function: 0xf83cd0
>                 "url_param": (function) function: 0xf821b0
>                 "sc2_tracked": (function) function: 0xf87710
>                 "sc_tracked": (function) function: 0xf84ba0
>                 "sc0_conn_cnt": (function) function: 0xf84df0
>                 "queue": (function) function: 0xf825a0
>                 "sc0_conn_cur": (function) function: 0xf84e60
>                 "req_hdr_names": (function) function: 0xf82870
>                 "scook_cnt": (function) function: 0xf82e20
>                 "sc1_trackers": (function) function: 0xf839a0
>                 "res_hdr_cnt": (function) function: 0xf82bf0
>                 "base32": (function) function: 0xf81050
>                 "req_body_len": (function) function: 0xf81ea0
>                 "src_kbytes_in": (function) function: 0xf87e70
>                 "capture_res_hdr": (function) function: 0xf81420
>                 "sc1_bytes_in_rate": (function) function: 0xf855b0
>                 "sc1_sess_cnt": (function) function: 0xf83850
>                 "rdp_cookie_cnt": (function) function: 0xf88870
>                 "nbproc": (function) function: 0xf88320
>                 "res_payload": (function) function: 0xf88f50
>                 "sc1_get_gpc0": (function) function: 0xf83420
>                 "sc1_conn_cnt": (function) function: 0xf83260
>                 "payload_lv": (function) function: 0xf88790
>                 "always_true": (function) function: 0xf88200
>                 "so_id": (function) function: 0xf80cd0
>                 "sc2_get_gpc0": (function) function: 0xf83d40
>                 "req_rdp_cookie_cnt": (function) function: 0xf88cd0
>                 "sc1_conn_rate": (function) function: 0xf83340
>                 "sc2_sess_rate": (function) function: 0xf876a0
>                 "sc_clr_gpc0": (function) function: 0xf84480
>                 "sc2_sess_cnt": (function) function: 0xf87630
>                 "sc_sess_cnt": (function) function: 0xf84ac0
>                 "connslots": (function) function: 0xf824c0
>                 "req_fhdr": (function) function: 0xf818f0
>                 "src_inc_gpc0": (function) function: 0xf87e00
>                 "ssl_fc_protocol": (function) function: 0xf80360
>                 "ssl_c_i_dn": (function) function: 0xf89640
>                 "sc_http_req_cnt": (function) function: 0xf84880
>                 "sc0_http_err_cnt": (function) function: 0xf850a0
>                 "sc0_sess_rate": (function) function: 0xf85450
>                 "req_rdp_cookie": (function) function: 0xf88c50
>                 "sc0_trackers": (function) function: 0xf85530
>                 "res_ssl_hello_type": (function) function: 0xf89040
>                 "sc_http_req_rate": (function) function: 0xf84900
>                 "hdr_ip": (function) function: 0xf812c0
>                 "ssl_c_der": (function) function: 0xf89560
>                 "sc0_http_err_rate": (function) function: 0xf85120
>                 "status": (function) function: 0xf83100
>                 "res_cook_cnt": (function) function: 0xf829c0
>                 "sc0_get_gpc0": (function) function: 0xf84fb0
>                 "ssl_bc_alg_keysize": (function) function: 0xf891a0
>                 "be_sess_rate": (function) function: 0xf82450
>                 "ssl_bc_session_id": (function) function: 0xf89400
>                 "shdr_val": (function) function: 0xf830c0
>                 "fe_sess_rate": (function) function: 0xf80ed0
>                 "sc0_conn_rate": (function) function: 0xf84ed0
>                 "table_avl": (function) function: 0xf880b0
>                 "res_cook_val": (function) function: 0xf82a30
>                 "shdr_ip": (function) function: 0xf83050
>                 "be_id": (function) function: 0xf823e0
>                 "ssl_bc_protocol": (function) function: 0xf89280
>                 "src": (function) function: 0xf842a0
>                 "scook_val": (function) function: 0xf82e90
>                 "ssl_c_serial": (function) function: 0xf898e0
>                 "src_get_gpt0": (function) function: 0xf87ab0
>                 "src_updt_conn_cnt": (function) function: 0xf88040
>                 "ssl_c_notafter": (function) function: 0xf89720
>                 "src_http_req_cnt": (function) function: 0xf87d10
>                 "src_kbytes_out": (function) function: 0xf87ee0
>                 "req_hdr_ip": (function) function: 0xf82800
>                 "src_conn_cnt": (function) function: 0xf87960
>                 "base": (function) function: 0xf80dd0
>                 "sc1_kbytes_in": (function) function: 0xf83770
>                 "env": (function) function: 0xf88270
>                 "ssl_f_notafter": (function) function: 0xf7fd20
>                 "srv_is_up": (function) function: 0xf826f0
>                 "ipv4": (function) function: 0xf88560
>                 "sc0_kbytes_in": (function) function: 0xf85300
>                 "url32_src": (function) function: 0xf82060
>                 "src_sess_cnt": (function) function: 0xf87f50
>                 "src_http_req_rate": (function) function: 0xf87d90
>                 "sc1_http_err_rate": (function) function: 0xf83590
>                 "sc_kbytes_out": (function) function: 0xf84a50
>                 "sc2_bytes_in_rate": (function) function: 0xf83a20
>                 "sc2_trackers": (function) function: 0xf87780
>                 "ssl_f_notbefore": (function) function: 0xf7fd90
>                 "wait_end": (function) function: 0xf890b0
>                 "sc_kbytes_in": (function) function: 0xf849e0
>                 "req_hdr": (function) function: 0xf819d0
>                 "ssl_c_err": (function) function: 0xf895d0
>                 "url_port": (function) function: 0xf82140
>                 "res_hdr_names": (function) function: 0xf82cd0
>                 "scook": (function) function: 0xf82db0
>                 "shdr": (function) function: 0xf82f70
>                 "url": (function) function: 0xf81f80
>                 "capture_res_ver": (function) function: 0xf81490
>                 "capture_req_method": (function) function: 0xf80f50
>                 "stopping": (function) function: 0xf88470
>                 "sc_get_gpt0": (function) function: 0xf84640
>                 "req_ssl_st_ext": (function) function: 0xf88db0
>                 "sc2_http_err_cnt": (function) function: 0xf83e30
>                 "srv_sess_rate": (function) function: 0xf84150
>                 "res_ver": (function) function: 0xf816c0
>                 "req_cook_val": (function) function: 0xf81880
>                 "src_bytes_in_rate": (function) function: 0xf87800
>                 "sc2_conn_rate": (function) function: 0xf83c60
>                 "hdr_val": (function) function: 0xf81330
>                 "src_get_gpc0": (function) function: 0xf87b20
>                 "req_ver": (function) function: 0xf81dc0
>                 "ssl_f_sig_alg": (function) function: 0xf7fe00
>                 "req_cook": (function) function: 0xf817a0
>                 "sc2_conn_cur": (function) function: 0xf83bf0
>                 "sc2_kbytes_in": (function) function: 0xf84090
>                 "ssl_c_version": (function) function: 0xf7fb60
>                 "res_fhdr": (function) function: 0xf82aa0
>                 "rep_ssl_hello_type": (function) function: 0xf888f0
>                 "sc1_conn_cur": (function) function: 0xf832d0
>                 "ssl_c_sig_alg": (function) function: 0xf89800
>                 "sc1_clr_gpc0": (function) function: 0xf831f0
>                 "sc_bytes_out_rate": (function) function: 0xf84410
>                 "src_http_err_cnt": (function) function: 0xf87c10
>                 "res_comp_algo": (function) function: 0xf886b0
>                 "req_body_size": (function) function: 0xf81f10
>                 "sc1_inc_gpc0": (function) function: 0xf83700
>                 "proc": (function) function: 0xf88390
>                 "sc2_http_err_rate": (function) function: 0xf83eb0
>                 "ssl_c_verify": (function) function: 0xf7faf0
>                 "ssl_f_der": (function) function: 0xf7fbd0
>                 "payload": (function) function: 0xf88720
>                 "sc_sess_rate": (function) function: 0xf84b30
>                 "table_cnt": (function) function: 0xf88120
>                 "ssl_f_version": (function) function: 0xf7ffc0
>                 "ssl_c_used": (function) function: 0xf7fa80
>                 "ssl_fc_is_resumed": (function) function: 0xf80280
>                 "urlp": (function) function: 0xf82220
>                 "req_fhdr_cnt": (function) function: 0xf81960
>                 "ssl_fc_has_sni": (function) function: 0xf80200
>                 "fe_id": (function) function: 0xf80e60
>                 "hdr_cnt": (function) function: 0xf81250
>                 "cook_cnt": (function) function: 0xf815e0
>                 "url32": (function) function: 0xf81ff0
>                 "ssl_fc_unique_id": (function) function: 0xf803e0
>                 "ssl_bc_unique_id": (function) function: 0xf89300
>                 "ssl_bc_use_keysize": (function) function: 0xf89380
>                 "cook_val": (function) function: 0xf81170
>                 "ssl_f_sha1": (function) function: 0xf7ff50
>                 "ssl_f_serial": (function) function: 0xf7fee0
>                 "sc2_gpc0_rate": (function) function: 0xf83db0
>                 "capture_req_uri": (function) function: 0xf80fc0
>                 "res_fhdr_cnt": (function) function: 0xf82b10
>                 "srv_conn": (function) function: 0xf82610
>                 "rand": (function) function: 0xf88400
>                 "fe_conn": (function) function: 0xf80d60
>                 "cookie": (function) function: 0xf81570
>                 "sc2_clr_gpc0": (function) function: 0xf83b10
>                 "sc0_gpc0_rate": (function) function: 0xf85020
>                 "sc2_http_req_rate": (function) function: 0xf83fb0
>                 "sc_bytes_in_rate": (function) function: 0xf84390
>                 "dst": (function) function: 0xf841c0
>                 "ssl_f_key_alg": (function) function: 0xf7fcb0
>                 "sc0_clr_gpc0": (function) function: 0xf84d80
>                 "ssl_f_i_dn": (function) function: 0xf7fc40
>                 "src_conn_rate": (function) function: 0xf87a40
>                 "sc_trackers": (function) function: 0xf84c10
>                 "src_port": (function) function: 0xf84310
>                 "sc0_sess_cnt": (function) function: 0xf853e0
>                 "ssl_fc_npn": (function) function: 0xf802f0
>                 "ssl_c_sha1": (function) function: 0xf89950
>                 "ssl_c_s_dn": (function) function: 0xf89870
>                 "ssl_c_notbefore": (function) function: 0xf89790
>                 "dst_port": (function) function: 0xf84230
>                 "req_hdr_val": (function) function: 0xf828e0
>                 "url_ip": (function) function: 0xf820d0
>                 "sc2_inc_gpc0": (function) function: 0xf84020
>                 "srv_id": (function) function: 0xf82680
>                 "ssl_c_ca_err": (function) function: 0xf89470
>                 "path": (function) function: 0xf81bf0
>                 "sc2_http_req_cnt": (function) function: 0xf83f30
>                 "req_cook_cnt": (function) function: 0xf81810
>                 "rdp_cookie": (function) function: 0xf88800
>                 "ssl_bc_cipher": (function) function: 0xf89210
>                 "ssl_bc": (function) function: 0xf89120
>                 "sc_conn_cnt": (function) function: 0xf844f0
>                 "ssl_c_ca_err_depth": (function) function: 0xf894f0
>                 "sc_http_err_cnt": (function) function: 0xf84790
>                 "sc0_inc_gpc0": (function) function: 0xf85290
>                 "capture_req_ver": (function) function: 0xf813b0
>                 "res_len": (function) function: 0xf88ee0
>                 "req_ssl_ver": (function) function: 0xf88e70
>                 "req_ssl_ec_ext": (function) function: 0xf88d40
>                 "sc_http_err_rate": (function) function: 0xf84810
>                 "req_payload": (function) function: 0xf88b70
>                 "req_ssl_sni": (function) function: 0xf88e30
>                 "req_ssl_hello_type": (function) function: 0xf88df0
>                 "sc1_get_gpt0": (function) function: 0xf833b0
>                 "sc0_http_req_cnt": (function) function: 0xf851a0
>                 "res_cook": (function) function: 0xf82950
>                 "src_conn_cur": (function) function: 0xf879d0
>                 "http_first_req": (function) function: 0xf81b40
>                 "src_clr_gpc0": (function) function: 0xf878f0
>                 "http_auth": (function) function: 0xf81a60
>                 "res_comp": (function) function: 0xf88640
>                 "set_cookie": (function) function: 0xf82f00
>                 "int": (function) function: 0xf884f0
>                 "sc0_tracked": (function) function: 0xf854c0
>                 "sc2_bytes_out_rate": (function) function: 0xf83aa0
>                 "sc_gpc0_rate": (function) function: 0xf84720
>                 "req_body_param": (function) function: 0xf81650
>                 "ssl_fc_use_keysize": (function) function: 0xf80460
>                 "src_bytes_out_rate": (function) function: 0xf87880
>                 "res_hdr_ip": (function) function: 0xf82c60
>                 "capture_req_hdr": (function) function: 0xf81130
>                 "method": (function) function: 0xf81bb0
>                 "sc1_gpc0_rate": (function) function: 0xf83490
>                 "http_auth_group": (function) function: 0xf81ad0
>                 "res_hdr_val": (function) function: 0xf82d40
>                 "shdr_cnt": (function) function: 0xf82fe0
>                 "resp_ver": (function) function: 0xf81730
>                 "query": (function) function: 0xf81c60
>                 "urlp_val": (function) function: 0xf82290
>             ]
>             "__tostring": (function) function: 0xf7bba0
>         ]
>         0: (userdata) userdata: 0x10c7c08
>     ]
>     "sf": (table) HAProxy class Fetches [
>         METATABLE: (table) table: 0xf7c590 [
>             "__index": (table) table: 0xf7bbe0 [
>                 "sc1_http_err_cnt": (function) function: 0xf83510
>                 "nbsrv": (function) function: 0xf82530
>                 "ssl_fc_has_crt": (function) function: 0xf80190
>                 "sc_conn_cur": (function) function: 0xf84560
>                 "date": (function) function: 0xf882b0
>                 "src_sess_rate": (function) function: 0xf87fc0
>                 "req_len": (function) function: 0xf88b00
>                 "sc1_kbytes_out": (function) function: 0xf837e0
>                 "sc2_conn_cnt": (function) function: 0xf83b80
>                 "sc0_kbytes_out": (function) function: 0xf85370
>                 "be_conn": (function) function: 0xf82370
>                 "sc1_http_req_rate": (function) function: 0xf83690
>                 "ssl_fc_session_id": (function) function: 0xf804e0
>                 "req_body": (function) function: 0xf81e30
>                 "src_http_err_rate": (function) function: 0xf87c90
>                 "sc0_bytes_out_rate": (function) function: 0xf84d10
>                 "sc0_get_gpt0": (function) function: 0xf84f40
>                 "sc_conn_rate": (function) function: 0xf845d0
>                 "dst_conn": (function) function: 0xf7bc50
>                 "sc2_kbytes_out": (function) function: 0xf84100
>                 "sc1_tracked": (function) function: 0xf83930
>                 "res_payload_lv": (function) function: 0xf88fc0
>                 "always_false": (function) function: 0xf88190
>                 "sc1_http_req_cnt": (function) function: 0xf83610
>                 "ssl_f_s_dn": (function) function: 0xf7fe70
>                 "res_hdr": (function) function: 0xf82b80
>                 "ssl_c_key_alg": (function) function: 0xf896b0
>                 "sc1_bytes_out_rate": (function) function: 0xf83180
>                 "sc0_http_req_rate": (function) function: 0xf85220
>                 "sc_get_gpc0": (function) function: 0xf846b0
>                 "avg_queue": (function) function: 0xf82300
>                 "ssl_fc_cipher": (function) function: 0xf80120
>                 "sc0_bytes_in_rate": (function) function: 0xf84c90
>                 "base32_src": (function) function: 0xf810c0
>                 "ssl_fc_alg_keysize": (function) function: 0xf800b0
>                 "str": (function) function: 0xf884b0
>                 "hdr": (function) function: 0xf811e0
>                 "ssl_fc": (function) function: 0xf80030
>                 "req_proto_http": (function) function: 0xf81d10
>                 "ssl_fc_sni": (function) function: 0xf80550
>                 "req_payload_lv": (function) function: 0xf88be0
>                 "req_hdr_cnt": (function) function: 0xf82790
>                 "src_gpc0_rate": (function) function: 0xf87b90
>                 "sc1_sess_rate": (function) function: 0xf838c0
>                 "ipv6": (function) function: 0xf885d0
>                 "cook": (function) function: 0xf81500
>                 "sc_inc_gpc0": (function) function: 0xf84970
>                 "sc2_get_gpt0": (function) function: 0xf83cd0
>                 "url_param": (function) function: 0xf821b0
>                 "sc2_tracked": (function) function: 0xf87710
>                 "sc_tracked": (function) function: 0xf84ba0
>                 "sc0_conn_cnt": (function) function: 0xf84df0
>                 "queue": (function) function: 0xf825a0
>                 "sc0_conn_cur": (function) function: 0xf84e60
>                 "req_hdr_names": (function) function: 0xf82870
>                 "scook_cnt": (function) function: 0xf82e20
>                 "sc1_trackers": (function) function: 0xf839a0
>                 "res_hdr_cnt": (function) function: 0xf82bf0
>                 "base32": (function) function: 0xf81050
>                 "req_body_len": (function) function: 0xf81ea0
>                 "src_kbytes_in": (function) function: 0xf87e70
>                 "capture_res_hdr": (function) function: 0xf81420
>                 "sc1_bytes_in_rate": (function) function: 0xf855b0
>                 "sc1_sess_cnt": (function) function: 0xf83850
>                 "rdp_cookie_cnt": (function) function: 0xf88870
>                 "nbproc": (function) function: 0xf88320
>                 "res_payload": (function) function: 0xf88f50
>                 "sc1_get_gpc0": (function) function: 0xf83420
>                 "sc1_conn_cnt": (function) function: 0xf83260
>                 "payload_lv": (function) function: 0xf88790
>                 "always_true": (function) function: 0xf88200
>                 "so_id": (function) function: 0xf80cd0
>                 "sc2_get_gpc0": (function) function: 0xf83d40
>                 "req_rdp_cookie_cnt": (function) function: 0xf88cd0
>                 "sc1_conn_rate": (function) function: 0xf83340
>                 "sc2_sess_rate": (function) function: 0xf876a0
>                 "sc_clr_gpc0": (function) function: 0xf84480
>                 "sc2_sess_cnt": (function) function: 0xf87630
>                 "sc_sess_cnt": (function) function: 0xf84ac0
>                 "connslots": (function) function: 0xf824c0
>                 "req_fhdr": (function) function: 0xf818f0
>                 "src_inc_gpc0": (function) function: 0xf87e00
>                 "ssl_fc_protocol": (function) function: 0xf80360
>                 "ssl_c_i_dn": (function) function: 0xf89640
>                 "sc_http_req_cnt": (function) function: 0xf84880
>                 "sc0_http_err_cnt": (function) function: 0xf850a0
>                 "sc0_sess_rate": (function) function: 0xf85450
>                 "req_rdp_cookie": (function) function: 0xf88c50
>                 "sc0_trackers": (function) function: 0xf85530
>                 "res_ssl_hello_type": (function) function: 0xf89040
>                 "sc_http_req_rate": (function) function: 0xf84900
>                 "hdr_ip": (function) function: 0xf812c0
>                 "ssl_c_der": (function) function: 0xf89560
>                 "sc0_http_err_rate": (function) function: 0xf85120
>                 "status": (function) function: 0xf83100
>                 "res_cook_cnt": (function) function: 0xf829c0
>                 "sc0_get_gpc0": (function) function: 0xf84fb0
>                 "ssl_bc_alg_keysize": (function) function: 0xf891a0
>                 "be_sess_rate": (function) function: 0xf82450
>                 "ssl_bc_session_id": (function) function: 0xf89400
>                 "shdr_val": (function) function: 0xf830c0
>                 "fe_sess_rate": (function) function: 0xf80ed0
>                 "sc0_conn_rate": (function) function: 0xf84ed0
>                 "table_avl": (function) function: 0xf880b0
>                 "res_cook_val": (function) function: 0xf82a30
>                 "shdr_ip": (function) function: 0xf83050
>                 "be_id": (function) function: 0xf823e0
>                 "ssl_bc_protocol": (function) function: 0xf89280
>                 "src": (function) function: 0xf842a0
>                 "scook_val": (function) function: 0xf82e90
>                 "ssl_c_serial": (function) function: 0xf898e0
>                 "src_get_gpt0": (function) function: 0xf87ab0
>                 "src_updt_conn_cnt": (function) function: 0xf88040
>                 "ssl_c_notafter": (function) function: 0xf89720
>                 "src_http_req_cnt": (function) function: 0xf87d10
>                 "src_kbytes_out": (function) function: 0xf87ee0
>                 "req_hdr_ip": (function) function: 0xf82800
>                 "src_conn_cnt": (function) function: 0xf87960
>                 "base": (function) function: 0xf80dd0
>                 "sc1_kbytes_in": (function) function: 0xf83770
>                 "env": (function) function: 0xf88270
>                 "ssl_f_notafter": (function) function: 0xf7fd20
>                 "srv_is_up": (function) function: 0xf826f0
>                 "ipv4": (function) function: 0xf88560
>                 "sc0_kbytes_in": (function) function: 0xf85300
>                 "url32_src": (function) function: 0xf82060
>                 "src_sess_cnt": (function) function: 0xf87f50
>                 "src_http_req_rate": (function) function: 0xf87d90
>                 "sc1_http_err_rate": (function) function: 0xf83590
>                 "sc_kbytes_out": (function) function: 0xf84a50
>                 "sc2_bytes_in_rate": (function) function: 0xf83a20
>                 "sc2_trackers": (function) function: 0xf87780
>                 "ssl_f_notbefore": (function) function: 0xf7fd90
>                 "wait_end": (function) function: 0xf890b0
>                 "sc_kbytes_in": (function) function: 0xf849e0
>                 "req_hdr": (function) function: 0xf819d0
>                 "ssl_c_err": (function) function: 0xf895d0
>                 "url_port": (function) function: 0xf82140
>                 "res_hdr_names": (function) function: 0xf82cd0
>                 "scook": (function) function: 0xf82db0
>                 "shdr": (function) function: 0xf82f70
>                 "url": (function) function: 0xf81f80
>                 "capture_res_ver": (function) function: 0xf81490
>                 "capture_req_method": (function) function: 0xf80f50
>                 "stopping": (function) function: 0xf88470
>                 "sc_get_gpt0": (function) function: 0xf84640
>                 "req_ssl_st_ext": (function) function: 0xf88db0
>                 "sc2_http_err_cnt": (function) function: 0xf83e30
>                 "srv_sess_rate": (function) function: 0xf84150
>                 "res_ver": (function) function: 0xf816c0
>                 "req_cook_val": (function) function: 0xf81880
>                 "src_bytes_in_rate": (function) function: 0xf87800
>                 "sc2_conn_rate": (function) function: 0xf83c60
>                 "hdr_val": (function) function: 0xf81330
>                 "src_get_gpc0": (function) function: 0xf87b20
>                 "req_ver": (function) function: 0xf81dc0
>                 "ssl_f_sig_alg": (function) function: 0xf7fe00
>                 "req_cook": (function) function: 0xf817a0
>                 "sc2_conn_cur": (function) function: 0xf83bf0
>                 "sc2_kbytes_in": (function) function: 0xf84090
>                 "ssl_c_version": (function) function: 0xf7fb60
>                 "res_fhdr": (function) function: 0xf82aa0
>                 "rep_ssl_hello_type": (function) function: 0xf888f0
>                 "sc1_conn_cur": (function) function: 0xf832d0
>                 "ssl_c_sig_alg": (function) function: 0xf89800
>                 "sc1_clr_gpc0": (function) function: 0xf831f0
>                 "sc_bytes_out_rate": (function) function: 0xf84410
>                 "src_http_err_cnt": (function) function: 0xf87c10
>                 "res_comp_algo": (function) function: 0xf886b0
>                 "req_body_size": (function) function: 0xf81f10
>                 "sc1_inc_gpc0": (function) function: 0xf83700
>                 "proc": (function) function: 0xf88390
>                 "sc2_http_err_rate": (function) function: 0xf83eb0
>                 "ssl_c_verify": (function) function: 0xf7faf0
>                 "ssl_f_der": (function) function: 0xf7fbd0
>                 "payload": (function) function: 0xf88720
>                 "sc_sess_rate": (function) function: 0xf84b30
>                 "table_cnt": (function) function: 0xf88120
>                 "ssl_f_version": (function) function: 0xf7ffc0
>                 "ssl_c_used": (function) function: 0xf7fa80
>                 "ssl_fc_is_resumed": (function) function: 0xf80280
>                 "urlp": (function) function: 0xf82220
>                 "req_fhdr_cnt": (function) function: 0xf81960
>                 "ssl_fc_has_sni": (function) function: 0xf80200
>                 "fe_id": (function) function: 0xf80e60
>                 "hdr_cnt": (function) function: 0xf81250
>                 "cook_cnt": (function) function: 0xf815e0
>                 "url32": (function) function: 0xf81ff0
>                 "ssl_fc_unique_id": (function) function: 0xf803e0
>                 "ssl_bc_unique_id": (function) function: 0xf89300
>                 "ssl_bc_use_keysize": (function) function: 0xf89380
>                 "cook_val": (function) function: 0xf81170
>                 "ssl_f_sha1": (function) function: 0xf7ff50
>                 "ssl_f_serial": (function) function: 0xf7fee0
>                 "sc2_gpc0_rate": (function) function: 0xf83db0
>                 "capture_req_uri": (function) function: 0xf80fc0
>                 "res_fhdr_cnt": (function) function: 0xf82b10
>                 "srv_conn": (function) function: 0xf82610
>                 "rand": (function) function: 0xf88400
>                 "fe_conn": (function) function: 0xf80d60
>                 "cookie": (function) function: 0xf81570
>                 "sc2_clr_gpc0": (function) function: 0xf83b10
>                 "sc0_gpc0_rate": (function) function: 0xf85020
>                 "sc2_http_req_rate": (function) function: 0xf83fb0
>                 "sc_bytes_in_rate": (function) function: 0xf84390
>                 "dst": (function) function: 0xf841c0
>                 "ssl_f_key_alg": (function) function: 0xf7fcb0
>                 "sc0_clr_gpc0": (function) function: 0xf84d80
>                 "ssl_f_i_dn": (function) function: 0xf7fc40
>                 "src_conn_rate": (function) function: 0xf87a40
>                 "sc_trackers": (function) function: 0xf84c10
>                 "src_port": (function) function: 0xf84310
>                 "sc0_sess_cnt": (function) function: 0xf853e0
>                 "ssl_fc_npn": (function) function: 0xf802f0
>                 "ssl_c_sha1": (function) function: 0xf89950
>                 "ssl_c_s_dn": (function) function: 0xf89870
>                 "ssl_c_notbefore": (function) function: 0xf89790
>                 "dst_port": (function) function: 0xf84230
>                 "req_hdr_val": (function) function: 0xf828e0
>                 "url_ip": (function) function: 0xf820d0
>                 "sc2_inc_gpc0": (function) function: 0xf84020
>                 "srv_id": (function) function: 0xf82680
>                 "ssl_c_ca_err": (function) function: 0xf89470
>                 "path": (function) function: 0xf81bf0
>                 "sc2_http_req_cnt": (function) function: 0xf83f30
>                 "req_cook_cnt": (function) function: 0xf81810
>                 "rdp_cookie": (function) function: 0xf88800
>                 "ssl_bc_cipher": (function) function: 0xf89210
>                 "ssl_bc": (function) function: 0xf89120
>                 "sc_conn_cnt": (function) function: 0xf844f0
>                 "ssl_c_ca_err_depth": (function) function: 0xf894f0
>                 "sc_http_err_cnt": (function) function: 0xf84790
>                 "sc0_inc_gpc0": (function) function: 0xf85290
>                 "capture_req_ver": (function) function: 0xf813b0
>                 "res_len": (function) function: 0xf88ee0
>                 "req_ssl_ver": (function) function: 0xf88e70
>                 "req_ssl_ec_ext": (function) function: 0xf88d40
>                 "sc_http_err_rate": (function) function: 0xf84810
>                 "req_payload": (function) function: 0xf88b70
>                 "req_ssl_sni": (function) function: 0xf88e30
>                 "req_ssl_hello_type": (function) function: 0xf88df0
>                 "sc1_get_gpt0": (function) function: 0xf833b0
>                 "sc0_http_req_cnt": (function) function: 0xf851a0
>                 "res_cook": (function) function: 0xf82950
>                 "src_conn_cur": (function) function: 0xf879d0
>                 "http_first_req": (function) function: 0xf81b40
>                 "src_clr_gpc0": (function) function: 0xf878f0
>                 "http_auth": (function) function: 0xf81a60
>                 "res_comp": (function) function: 0xf88640
>                 "set_cookie": (function) function: 0xf82f00
>                 "int": (function) function: 0xf884f0
>                 "sc0_tracked": (function) function: 0xf854c0
>                 "sc2_bytes_out_rate": (function) function: 0xf83aa0
>                 "sc_gpc0_rate": (function) function: 0xf84720
>                 "req_body_param": (function) function: 0xf81650
>                 "ssl_fc_use_keysize": (function) function: 0xf80460
>                 "src_bytes_out_rate": (function) function: 0xf87880
>                 "res_hdr_ip": (function) function: 0xf82c60
>                 "capture_req_hdr": (function) function: 0xf81130
>                 "method": (function) function: 0xf81bb0
>                 "sc1_gpc0_rate": (function) function: 0xf83490
>                 "http_auth_group": (function) function: 0xf81ad0
>                 "res_hdr_val": (function) function: 0xf82d40
>                 "shdr_cnt": (function) function: 0xf82fe0
>                 "resp_ver": (function) function: 0xf81730
>                 "query": (function) function: 0xf81c60
>                 "urlp_val": (function) function: 0xf82290
>             ]
>             "__tostring": (function) function: 0xf7bba0
>         ]
>         0: (userdata) userdata: 0x1029fc8
>     ]
> ]
> 
> 
> On Mon, Dec 14, 2015 at 12:56 AM, Thierry FOURNIER <
> [email protected]> wrote:
> 
> > On Fri, 11 Dec 2015 17:05:16 -0800
> > Hugues Alary <[email protected]> wrote:
> >
> > > Hi there,
> > >
> > > I'm trying my hands on haproxy 1.6.2 and I'm excited about the LUA
> > > integration.
> > >
> > > I'm however running into an issue and can't figure out why. Please
> > forgive
> > > me if my issue is only due to my complete ignorance about LUA (I
> > literally
> > > just opened the language documentation).
> > >
> > > I'm trying to call the txn:get_headers() function, but when doing so, I
> > get
> > > the following error in my logs: "Lua function 'myFunc': runtime error:
> > > /etc/haproxy/hello_world.lua:2: attempt to call a nil value (method
> > > 'get_headers')."
> >
> >
> > Hi,
> >
> > This is strange: Lua says that you try to "call a nil value" when you
> > try to execute a funciton which doesn't exists.
> >
> > In your case, the fucntion exists. You can dump the full stuct of the
> > "txn" var with the function below:
> >
> >    http://ww.arpalert.org/haproxy-scripts.html#print_r
> >
> > Just add "print_r(txn)", and you will be fixed about the content of the
> > object "txn".
> >
> > I read the haproxu luacode to be sure of the existence of these
> > function, and I sew that it was renamed. So, try the function:
> >
> >    req_get_headers()
> >
> > The API doc:
> >
> >    http://www.arpalert.org/src/haproxy-lua-api/1.7dev/#txn-class
> >
> > Thierry.
> >
> >
> > > function myFunc(txn)
> > >   txn:get_headers()
> > > end
> > >
> > > core.register_action("myFunc", { "http-req" }, myFunc);
> > >
> > > Is this a bug, or just me not knowing what I'm doing?
> > >
> > > It's worth noting that calling: txn:done() works.
> > >
> > > Sincerely,
> > > -Hugues
> >

Reply via email to