MEDIUM: log-format: backend source address %Bi %Bp

%Bi return the backend source IP
%Bp return the backend source port

Add a function pointer in logformat_type to do additional configuration
during the log-format variable parsing.
This commit is contained in:
William Lallemand
2012-03-02 14:35:21 +01:00
committed by Willy Tarreau
parent bddd4fd93b
commit b7ff6a3a36
8 changed files with 97 additions and 33 deletions

View File

@@ -44,6 +44,8 @@ enum {
LOG_GLOBAL,
LOG_CLIENTIP,
LOG_CLIENTPORT,
LOG_SOURCEPORT,
LOG_SOURCEIP,
LOG_DATE,
LOG_DATEGMT,
LOG_MS,

View File

@@ -138,7 +138,9 @@ enum {
#define PR_O2_NODELAY 0x00020000 /* fully interactive mode, never delay outgoing data */
#define PR_O2_USE_PXHDR 0x00040000 /* use Proxy-Connection for proxy requests */
#define PR_O2_CHK_SNDST 0x00080000 /* send the state of each server along with HTTP health checks */
/* unused: 0x00100000 */
#define PR_O2_SRC_ADDR 0x00100000 /* get the source ip and port for logs */
#define PR_O2_FAKE_KA 0x00200000 /* pretend we do keep-alive with server eventhough we close */
/* unused: 0x00400000 */
#define PR_O2_EXP_NONE 0x00000000 /* http-check : no expect rule */

View File

@@ -84,6 +84,7 @@
#define SN_IGNORE_PRST 0x00080000 /* ignore persistence */
#define SN_BE_TRACK_SC1 0x00100000 /* backend tracks stick-counter 1 */
#define SN_BE_TRACK_SC2 0x00200000 /* backend tracks stick-counter 2 */
#define SN_BCK_ADDR_SET 0x00400000 /* set if the backend address has been filled */
/* Termination sequence tracing.
*

View File

@@ -72,6 +72,7 @@ enum {
SI_FL_DONT_WAKE = 0x0020, /* resync in progress, don't wake up */
SI_FL_INDEP_STR = 0x0040, /* independant streams = don't update rex on write */
SI_FL_NOLINGER = 0x0080, /* may close without lingering. One-shot. */
SI_FL_SRC_ADDR = 0x1000, /* get the source ip/port with getsockname */
};
/* target types */