Use more intuitive letters for new format specs

%D for Destination host, %p for the (more interesting) destination port,
%S for Source host, %q for the (less interesting) source port.
pull/13/head
Daniel Roethlisberger 9 years ago
parent e17108f9b7
commit ce002378b8

20
log.c

@ -386,6 +386,14 @@ log_content_format_pathspec(const char *logspec,
elem = addrbuf;
elem_len = strlen(addrbuf);
break;
case 'D':
elem = dsthost;
elem_len = strlen(dsthost);
break;
case 'p':
elem = dstport;
elem_len = strlen(dstport);
break;
case 's':
if (snprintf(addrbuf, sizeof(addrbuf),
"%s,%s", srchost, srcport) < 0) {
@ -395,19 +403,11 @@ log_content_format_pathspec(const char *logspec,
elem = addrbuf;
elem_len = strlen(addrbuf);
break;
case 'f':
elem = dsthost;
elem_len = strlen(dsthost);
break;
case 'h':
elem = dstport;
elem_len = strlen(dstport);
break;
case 't':
case 'S':
elem = srchost;
elem_len = strlen(srchost);
break;
case 'v':
case 'q':
elem = srcport;
elem_len = strlen(srcport);
break;

@ -154,11 +154,11 @@ main_usage(void)
" -F pathspec content log: full data to sep files with %% subst (excl. -L/-S):\n"
" %%T - initial connection time as an ISO 8601 UTC timestamp\n"
" %%d - destination host and port\n"
" %%f - destination host\n"
" %%h - destination port\n"
" %%D - destination host\n"
" %%p - destination port\n"
" %%s - source host and port\n"
" %%t - source host\n"
" %%v - source port\n"
" %%S - source host\n"
" %%q - source port\n"
#ifdef HAVE_LOCAL_PROCINFO
" %%x - base name of local process (requires -i)\n"
" %%X - full path to local process (requires -i)\n"

@ -394,10 +394,22 @@ The initial connection time as an ISO 8601 UTC timestamp.
The destination host and port, separated by a comma, IPv6 addresses using
underscore instead of colon.
.TP
.I %D
The destination host, IPv6 addresses using underscore instead of colon.
.TP
.I %p
The destination port.
.TP
.I %s
The source host and port, separated by a comma, IPv6 addresses using
underscore instead of colon.
.TP
.I %S
The source host, IPv6 addresses using underscore instead of colon.
.TP
.I %q
The source port.
.TP
.I %x
The name of the local process.
Requires \fB-i\fP to be used.

Loading…
Cancel
Save