You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{A query tool that returns the complete details of any Query Service to generate reports.}
11
11
12
12
== Syntax
13
-
The basic syntax is:
14
13
15
14
----
16
-
cbqueryreportgen [-<args>]
15
+
cbqueryreportgen [-<args>
16
+
[ -c, --cluster <cluster> ]
17
+
[ -u, --username <username> ]
18
+
[ -p, --password <password> ]
19
+
[ -k, --keyspace <keyspace> ]
20
+
[ -t1, --time-period <time-period> ]
21
+
[ -o, --output <output> ]
22
+
[ --report-type <report-type> ]
23
+
[ --output-file <output-file> ]
24
+
[ --format <format> ]
25
+
[ -l, --limit <limit> ]
26
+
[ -v, --verbose ]
27
+
[ -h, --help ]
28
+
]
17
29
----
18
30
19
-
Required Flags:
20
-
-c, --cluster The hostname of the Couchbase cluster. Example: 'couchbase://localhost'.
21
-
-u, --username The username of the Couchbase cluster. Example: 'Administrator'.
22
-
-p, --password The password of the Couchbase cluster.
23
-
-k, --keyspace The keyspace where the awr stats are read from. Example: 'travel-sample._default.awr'.
24
-
-t1, --time-period The required format is 'start-time, end-time' in the format 'YYYY-MM-DDTHH:MM:SS'. Example: '2025-10-01T00:00:00,2025-10-02T00:00:00'.
25
-
-o, --output The output file to write the report to. Example: 'report.html'.
26
-
27
-
28
-
optional Flags:
29
-
30
-
--report-type The type of report to generate. Supported values are 'AWR' and 'ADHOC'. Default is 'AWR'(Automatic Workload Repository).
31
-
--output-file The file path where the report will be saved. If not provided, the report will be printed to stdout.
32
-
--format The format of the report. 'HTML' is the default format.
33
-
-l, --limit The maximum number of results to include for every query. The default is '1000'.
34
-
-v, --verbose Enable verbose logging for debugging purposes.
35
-
-h, --help Prints the help information.
36
31
37
32
== Description
38
33
39
-
cbqueryreportgen is a command-line tool that connects to a Couchbase cluster and generates performance reports based on the Query service's AWR statistics.
34
+
The 'cbqueryreportgen' command connects to a Couchbase cluster and generates performance reports based on the Query service's AWR statistics.
40
35
41
36
The tool allows users to specify a time range for the report, the type of report, and the output format.
42
37
By default, the output of the command is a report in HTML format.
43
38
You can save the generated report to a file or print it to the standard output.
44
39
45
-
For more information on how specific commands work, run "cbqueryreportgen --help".
46
-
47
-
ifeval::['{page-component-version}' == '8.0']
48
-
This tool is only available in Couchbase Server 8.0 and later.
49
-
endif::[]
50
-
51
-
Depending upon your platform, this tool is at the following locations:
The query report generation tool supports the following options:
70
-
71
-
The tool takes a single argument, which must be one of the following:
72
-
73
-
number::
74
-
A number representing an error code.
75
-
In this case, the tool returns the full details of the error matching the error code.
76
-
77
-
string::
78
-
A string.
79
-
In this case, the tool searches for the target string in all of the error message fields except for `USER ERROR`, and returns the full details of any errors that match the string.
80
-
81
-
regex::
82
-
A regular expression.
83
-
In this case, the tool searches for the regular expression in all of the error message fields except for `USER ERROR`, and returns the full details of any errors that match the pattern.
84
-
85
-
== Output
86
-
87
-
If the tool finds a single error that matches the find argument, it outputs the full details of the error.
88
-
89
-
If the tool finds multiple errors that match the find argument, it outputs a list showing the code and description of each matching error.
90
-
You can use the tool again, passing the code or description as an argument, to get the full details of any of these errors.
91
-
92
-
Full error details include some or all of the following fields.
93
-
94
-
[options="header", cols="50a,147a"]
95
-
|===
96
-
|Name|Description
97
-
98
-
|**APPLIES TO**
99
-
|One of the following:
100
-
101
-
* `cbq-shell`: The error applies to the cbq shell.
102
-
* `Server`: The error applies to the server.
103
-
104
-
|**CODE**
105
-
|A number representing the error.
106
-
107
-
|**DESCRIPTION**
108
-
|Message describing why the error occurred.
109
-
110
-
|**REASON**
111
-
|List of possible causes of the error.
112
-
113
-
|**USER ACTION**
114
-
|List of possible steps a user can take to mitigate the error.
115
-
116
-
|**USER ERROR**
117
-
|One of the following:
118
-
119
-
* `Yes`: The error was caused by the user.
120
-
* `No`: The error was caused by other services, or was internal to the server.
121
-
* `Maybe`: A combination of both.
122
-
|===
123
-
124
-
NOTE: The error details also include a `SYMBOL` field, which contains a representation string for the error.
125
-
This field is for internal use only, and is not shown in the output.
126
-
However, the tool does search this field when the find argument is a string or a regular expression.
40
+
The '--cluster' flag specifies the hostname of the Couchbase cluster. Example: 'couchbase://localhost'.
127
41
128
-
== Examples
42
+
The '--username' flag specifies the username of the Couchbase cluster. Example: 'Administrator'.
129
43
130
-
[[cbqueryreportgen-ex1]]
131
-
.Find error details by code number
132
-
====
133
-
.Command
134
-
[source,sh]
135
-
----
136
-
./cbqueryreportgen 5011
137
-
----
138
-
139
-
.Output
140
-
----
141
-
CODE
142
-
5011 (error)
143
-
144
-
145
-
DESCRIPTION
146
-
Abort: «reason»
147
-
148
-
149
-
REASON
150
-
The SQL++ abort() function was called in the statement.
151
-
e.g. SELECT abort('An example cause')
152
-
153
-
154
-
USER ERROR
155
-
Yes
156
-
157
-
158
-
APPLIES TO
159
-
Server
160
-
----
161
-
====
162
-
163
-
[cbqueryreportgen-ex2]
164
-
.Find error details by matching a string
165
-
====
166
-
.Command
167
-
[source,sh]
168
-
----
169
-
./cbqueryreportgen "A semantic error is present in the statement."
170
-
----
171
-
172
-
.Output
173
-
----
174
-
CODE
175
-
3100 (error)
44
+
The '--password' flag specifies the password of the Couchbase cluster. Example: 'password'.
176
45
46
+
The '--keyspace' flag specifies the keyspace where the AWR stats are read from. Example: 'travel-sample._default.awr'.
177
47
178
-
DESCRIPTION
179
-
A semantic error is present in the statement.
48
+
The '--time-period' flag specifies the time period for the report. The required format is 'start-time,end-time' in the format 'YYYY-MM-DDTHH:MM:SS'. Example: '2025-10-01T00:00:00,2025-10-02T00:00:00'.
180
49
50
+
The '--output' flag specifies the output file to write the report to. Example: 'report.html'.
181
51
182
-
REASON
183
-
The statement includes portions that violate semantic constraints.
52
+
optional Flags:
184
53
54
+
The '--report-type' flag specifies the type of report to generate. Supported values are 'AWR' and 'ADHOC'. Default is 'AWR'(Automatic Workload Repository).
185
55
186
-
USER ACTION
187
-
The cause will contain more detail on the violation; revise the statement and re-submit.
56
+
The '--output-file' flag specifies the file path where the report will be saved. If not provided, the report will be printed to stdout.
188
57
58
+
The '--format' flag specifies the format of the report. 'HTML' is the default format.
189
59
190
-
USER ERROR
191
-
Yes
60
+
The '-l, --limit' flag specifies the maximum number of results to include for every query. The default is '1000'.
192
61
62
+
The '-v, --verbose' flag enables verbose logging for debugging purposes.
193
63
194
-
APPLIES TO
195
-
Server
196
-
----
197
-
====
64
+
The '-h, --help' flag prints the help information.
198
65
199
-
[cbqueryreportgen-ex3]
200
-
.Find multiple errors by matching a string
201
-
====
202
-
.Command
203
-
[source,sh]
204
-
----
205
-
./cbqueryreportgen "semantic"
206
-
----
66
+
For more information on how the specific command works, run "cbqueryreportgen --help".
207
67
208
-
.Output
209
-
----
210
-
Matching errors
211
-
3100 A semantic error is present in the statement.
212
-
3220 «name» window function «clause» «reason»
213
-
3300 recursive_with semantics: «cause»
214
-
----
215
-
====
216
-
217
-
[cbqueryreportgen-ex4]
218
-
.Find multiple errors by matching a regular expression
219
-
====
220
-
.Command
221
-
[source,sh]
222
-
----
223
-
./cbqueryreportgen "[UI][NP]SERT"
224
-
----
225
-
226
-
.Output
227
-
----
228
-
Matching errors
229
-
3150 MERGE with ON KEY clause cannot have document key specification in INSERT action.
230
-
3160 MERGE with ON clause must have document key specification in INSERT action
231
-
3180 MERGE with ON KEY clause cannot have USE INDEX hint specified on target.
232
-
5006 Out of key validation space.
233
-
5050 No INSERT key for «document»
234
-
5060 No INSERT value for «document»
235
-
5070 Cannot INSERT non-string key «key» of type «type»
236
-
5071 Cannot INSERT non-OBJECT options «options» of type «type»
237
-
5072 No UPSERT key for «value»
238
-
5073 Cannot act on the same key multiple times in an UPSERT statement
239
-
5075 No UPSERT value for «value»
240
-
5078 Cannot UPSERT non-string key «key» of type «type».
241
-
5079 Cannot UPSERT non-OBJECT options «value» of type «type».
242
-
5330 Multiple INSERT of the same document (document key «key») in a MERGE statement
243
-
12036 Error in INSERT of key: «key»
244
-
15005 No keys to insert «details»
245
-
----
246
-
====
68
+
The `--version` flag prints to the console the version number of the Couchbase Server.
247
69
248
-
== See Also
70
+
== See Also
71
+
(Writer's NOTE: Should we include more information after this? If yes, will change the xref's to appropriate links else will remove this section.)
249
72
250
-
* The {sqlpp} xref:n1ql:n1ql-language-reference/metafun.adoc#cbqueryreportgen[cbqueryreportgen()] function
Download the command line tools package for your platform from the following links:
96
96
@@ -123,14 +123,15 @@ The versions of the utilities installed by the tools package are the same as the
123
123
124
124
For the Server developer tools package, the {tools-ver} version of the utilities `cbimport`, `cbexport`, `cbbackupmgr`, and `cbq` are compatible with the following Couchbase Server versions:
125
125
126
-
* 8.0
127
126
* 7.6.0, 7.6.1, 7.6.2, 7.6.3
128
127
* 7.2.x
129
128
* 7.1.x
130
129
* 7.0.x
131
130
132
131
You can download and use the latest version of the utilities (`cbimport`, `cbexport`, `cbbackupmgr`, and `cbq`) with earlier Couchbase Server versions.
133
132
133
+
The 'cbqueryreportgen' utility is supported only on Couchbase Server 8.0 and later.
134
+
134
135
For the Server admin tools package, do the following:
135
136
136
137
* Use the `--version` option to get the version of the utility. However, for the `cbc` utility, use the `cbc version` option.
0 commit comments