Commit 62764cac authored by Tollef Fog Heen's avatar Tollef Fog Heen

Rename -o to -m ; documentation

Rename -o added in last commit to -m, add documentation.
parent a69a4882
...@@ -315,6 +315,8 @@ main(int argc, char * const *argv) ...@@ -315,6 +315,8 @@ main(int argc, char * const *argv)
case 'w': case 'w':
w_arg = optarg; w_arg = optarg;
break; break;
case 'm':
o_flag = 1; /* fall through */
default: default:
if (VSL_Arg(vd, c, optarg) > 0) if (VSL_Arg(vd, c, optarg) > 0)
break; break;
......
...@@ -107,7 +107,7 @@ struct VSM_data *vd; ...@@ -107,7 +107,7 @@ struct VSM_data *vd;
static size_t nll; static size_t nll;
static int o_flag = 0; static int m_flag = 0;
static const char *format; static const char *format;
...@@ -516,7 +516,7 @@ h_ncsa(void *priv, enum vsl_tag tag, unsigned fd, ...@@ -516,7 +516,7 @@ h_ncsa(void *priv, enum vsl_tag tag, unsigned fd,
if (!lp->complete) if (!lp->complete)
return (reopen); return (reopen);
if (o_flag && !VSL_Matched(vd, lp->bitmap)) if (m_flag && !VSL_Matched(vd, lp->bitmap))
/* -o is in effect matching rule failed. Don't display */ /* -o is in effect matching rule failed. Don't display */
return (reopen); return (reopen);
...@@ -775,11 +775,8 @@ main(int argc, char *argv[]) ...@@ -775,11 +775,8 @@ main(int argc, char *argv[])
case 'c': case 'c':
/* XXX: Silently ignored: it's required anyway */ /* XXX: Silently ignored: it's required anyway */
break; break;
case 'o': case 'm':
o_flag = 1; m_flag = 1; /* Fall through */
if (VSL_Arg(vd, c, optarg) > 0)
break;
usage();
default: default:
if (VSL_Arg(vd, c, optarg) > 0) if (VSL_Arg(vd, c, optarg) > 0)
break; break;
......
...@@ -335,8 +335,8 @@ main(int argc, char **argv) ...@@ -335,8 +335,8 @@ main(int argc, char **argv)
case 'V': case 'V':
varnish_version("varnishtop"); varnish_version("varnishtop");
exit(0); exit(0);
case 'o': case 'm':
fprintf(stderr, "-o is not supported\n"); fprintf(stderr, "-m is not supported\n");
exit(1); exit(1);
default: default:
if (VSL_Arg(vd, o, optarg) > 0) if (VSL_Arg(vd, o, optarg) > 0)
......
...@@ -15,8 +15,8 @@ Varnish request histogram ...@@ -15,8 +15,8 @@ Varnish request histogram
SYNOPSIS SYNOPSIS
======== ========
varnishhist [-b] [-C] [-c] [-d] [-I regex] [-i tag] [-n varnish_name] varnishhist [-b] [-C] [-c] [-d] [-I regex] [-i tag] [-m tag:regex ...]
[-r file] [-V] [-w delay] [-X regex] [-x tag] [-n varnish_name] [-r file] [-V] [-w delay] [-X regex] [-x tag]
DESCRIPTION DESCRIPTION
=========== ===========
...@@ -51,6 +51,9 @@ The following options are available: ...@@ -51,6 +51,9 @@ The following options are available:
-i tag Include log entries with the specified tag. If neither -i tag Include log entries with the specified tag. If neither
-I nor -i is specified, all log entries are included. -I nor -i is specified, all log entries are included.
-m tag:regex only count transactions where tag matches regex. Multiple
-m options are AND-ed together.
-n Specifies the name of the varnishd instance to get logs -n Specifies the name of the varnishd instance to get logs
from. If -n is not specified, the host name is used. from. If -n is not specified, the host name is used.
......
...@@ -17,7 +17,7 @@ SYNOPSIS ...@@ -17,7 +17,7 @@ SYNOPSIS
======== ========
varnishlog [-a] [-b] [-C] [-c] [-D] [-d] [-I regex] [-i tag] [-k keep] varnishlog [-a] [-b] [-C] [-c] [-D] [-d] [-I regex] [-i tag] [-k keep]
[-n varnish_name] [-o [tag regex]] [-P file] [-r file] [-s num] [-u] [-V] [-n varnish_name] [-o] [-m tag:regex ...] [-P file] [-r file] [-s num] [-u] [-V]
[-w file] [-X regex] [-x tag] [-w file] [-X regex] [-x tag]
DESCRIPTION DESCRIPTION
...@@ -51,6 +51,9 @@ The following options are available: ...@@ -51,6 +51,9 @@ The following options are available:
-k num Only show the first num log records. -k num Only show the first num log records.
-m tag:regex only list transactions where tag matches regex. Multiple
-m options are AND-ed together.
-n Specifies the name of the varnishd instance to get logs from. If -n is not -n Specifies the name of the varnishd instance to get logs from. If -n is not
specified, the host name is used. specified, the host name is used.
......
...@@ -16,7 +16,7 @@ SYNOPSIS ...@@ -16,7 +16,7 @@ SYNOPSIS
======== ========
varnishncsa [-a] [-b] [-C] [-c] [-D] [-d] [-f] [-F format] [-I regex] varnishncsa [-a] [-b] [-C] [-c] [-D] [-d] [-f] [-F format] [-I regex]
[-i tag] [-n varnish_name] [-o tag regex] [-P file] [-r file] [-V] [-w file] [-i tag] [-n varnish_name] [-m tag:regex ...] [-P file] [-r file] [-V] [-w file]
[-X regex] [-x tag] [-X regex] [-x tag]
...@@ -110,8 +110,8 @@ The following options are available: ...@@ -110,8 +110,8 @@ The following options are available:
How the request was handled, whether it was a How the request was handled, whether it was a
cache hit, miss, pass, pipe or error. cache hit, miss, pass, pipe or error.
-o Filter log output to request groups that match a regular -m tag:regex only list records where tag matches regex. Multiple
expression on a specified tag. -m options are AND-ed together.
-n Specifies the name of the varnishd instance to get logs -n Specifies the name of the varnishd instance to get logs
from. If -n is not specified, the host name is used. from. If -n is not specified, the host name is used.
......
...@@ -17,8 +17,8 @@ Varnish object size request histogram ...@@ -17,8 +17,8 @@ Varnish object size request histogram
SYNOPSIS SYNOPSIS
======== ========
varnishsizes [-b] [-C] [-c] [-d] [-I regex] [-i tag] [-n varnish_name] varnishsizes [-b] [-C] [-c] [-d] [-I regex] [-i tag] [-m tag:regex ...]
[-r file] [-V] [-w delay] [-X regex] [-x tag] [-n varnish_name] [-r file] [-V] [-w delay] [-X regex] [-x tag]
DESCRIPTION DESCRIPTION
=========== ===========
...@@ -49,6 +49,9 @@ The following options are available: ...@@ -49,6 +49,9 @@ The following options are available:
-i tag Include log entries with the specified tag. If neither -I nor -i -i tag Include log entries with the specified tag. If neither -I nor -i
is specified, all log entries are included. is specified, all log entries are included.
-m tag:regex only list record where tag matches regex. Multiple -m
options are AND-ed together.
-n Specifies the name of the varnishd instance to get logs from. -n Specifies the name of the varnishd instance to get logs from.
If -n is not specified, the host name is used. If -n is not specified, the host name is used.
......
...@@ -214,7 +214,7 @@ int VSL_Open(struct VSM_data *vd, int diag); ...@@ -214,7 +214,7 @@ int VSL_Open(struct VSM_data *vd, int diag);
* != 0 on failure * != 0 on failure
*/ */
#define VSL_ARGS "bCcdI:i:k:n:r:s:X:x:o:" #define VSL_ARGS "bCcdI:i:k:n:r:s:X:x:m:"
#define VSL_b_USAGE "[-b]" #define VSL_b_USAGE "[-b]"
#define VSL_c_USAGE "[-c]" #define VSL_c_USAGE "[-c]"
#define VSL_C_USAGE "[-C]" #define VSL_C_USAGE "[-C]"
...@@ -222,8 +222,8 @@ int VSL_Open(struct VSM_data *vd, int diag); ...@@ -222,8 +222,8 @@ int VSL_Open(struct VSM_data *vd, int diag);
#define VSL_i_USAGE "[-i tag]" #define VSL_i_USAGE "[-i tag]"
#define VSL_I_USAGE "[-I regexp]" #define VSL_I_USAGE "[-I regexp]"
#define VSL_k_USAGE "[-k keep]" #define VSL_k_USAGE "[-k keep]"
#define VSL_m_USAGE "[-m tag:regex]"
#define VSL_n_USAGE VSM_n_USAGE #define VSL_n_USAGE VSM_n_USAGE
#define VSL_o_USAGE "[-o tag:regex]"
#define VSL_r_USAGE "[-r file]" #define VSL_r_USAGE "[-r file]"
#define VSL_s_USAGE "[-s skip]" #define VSL_s_USAGE "[-s skip]"
#define VSL_x_USAGE "[-x tag]" #define VSL_x_USAGE "[-x tag]"
...@@ -232,8 +232,8 @@ int VSL_Open(struct VSM_data *vd, int diag); ...@@ -232,8 +232,8 @@ int VSL_Open(struct VSM_data *vd, int diag);
VSL_i_USAGE " " \ VSL_i_USAGE " " \
VSL_I_USAGE " " \ VSL_I_USAGE " " \
VSL_k_USAGE " " \ VSL_k_USAGE " " \
VSL_m_USAGE " " \
VSL_n_USAGE " " \ VSL_n_USAGE " " \
VSL_o_USAGE " " \
VSL_r_USAGE " " \ VSL_r_USAGE " " \
VSL_s_USAGE " " \ VSL_s_USAGE " " \
VSL_X_USAGE " " \ VSL_X_USAGE " " \
......
...@@ -163,7 +163,7 @@ name2tag(const char *n) ...@@ -163,7 +163,7 @@ name2tag(const char *n)
} }
static int static int
vsl_o_arg(const struct VSM_data *vd, const char *opt) vsl_m_arg(const struct VSM_data *vd, const char *opt)
{ {
struct vsl_re_match *m; struct vsl_re_match *m;
const char *error; const char *error;
...@@ -264,7 +264,7 @@ VSL_Arg(struct VSM_data *vd, int arg, const char *opt) ...@@ -264,7 +264,7 @@ VSL_Arg(struct VSM_data *vd, int arg, const char *opt)
case 'r': return (vsl_r_arg(vd, opt)); case 'r': return (vsl_r_arg(vd, opt));
case 's': return (vsl_s_arg(vd, opt)); case 's': return (vsl_s_arg(vd, opt));
case 'I': case 'X': return (vsl_IX_arg(vd, opt, arg)); case 'I': case 'X': return (vsl_IX_arg(vd, opt, arg));
case 'o': return (vsl_o_arg(vd, opt)); case 'm': return (vsl_m_arg(vd, opt));
case 'C': vd->vsl->regflags = VRE_CASELESS; return (1); case 'C': vd->vsl->regflags = VRE_CASELESS; return (1);
default: default:
return (0); return (0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment