Skip to content

Commit c3be5c0

Browse files
Pallavi-Janardhansimon-dew
authored andcommitted
DOC-12541 Added a new file and modified the cli-intro file
1 parent 8de7118 commit c3be5c0

File tree

2 files changed

+37
-214
lines changed

2 files changed

+37
-214
lines changed
Lines changed: 34 additions & 212 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= cbqueryreportgen
2-
:description: pass:q[A query tool that returns the complete details of any Query service to generate reports.]
2+
:description: pass:q[The 'cbqueryreportgen' tool returns the complete details of any Query service to generate reports.]
33
:page-status: Couchbase Server 8.0
44
:page-component: Query
55
ifndef::doctype-manpage[:doctitle: cbqueryreportgen]
@@ -10,242 +10,64 @@ ifndef::doctype-manpage[:doctitle: cbqueryreportgen]
1010
{A query tool that returns the complete details of any Query Service to generate reports.}
1111

1212
== Syntax
13-
The basic syntax is:
1413

1514
----
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+
]
1729
----
1830

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.
3631

3732
== Description
3833

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.
4035

4136
The tool allows users to specify a time range for the report, the type of report, and the output format.
4237
By default, the output of the command is a report in HTML format.
4338
You can save the generated report to a file or print it to the standard output.
4439

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:
52-
53-
[cols="1,3"]
54-
|===
55-
| Operating system | Location
56-
57-
| Linux
58-
| [.path]`/opt/couchbase/bin/`
59-
60-
| Windows
61-
| [.path]`C:\Program Files\Couchbase\Server\bin\`
62-
63-
| Mac OS X
64-
| [.path]`/Applications/CouchbaseServer.app/Contents/Resources/couchbase-core/bin/`
65-
|===
66-
67-
== Options
68-
69-
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'.
12741

128-
== Examples
42+
The '--username' flag specifies the username of the Couchbase cluster. Example: 'Administrator'.
12943

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'.
17645

46+
The '--keyspace' flag specifies the keyspace where the AWR stats are read from. Example: 'travel-sample._default.awr'.
17747

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'.
18049

50+
The '--output' flag specifies the output file to write the report to. Example: 'report.html'.
18151

182-
REASON
183-
The statement includes portions that violate semantic constraints.
52+
optional Flags:
18453

54+
The '--report-type' flag specifies the type of report to generate. Supported values are 'AWR' and 'ADHOC'. Default is 'AWR'(Automatic Workload Repository).
18555

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.
18857

58+
The '--format' flag specifies the format of the report. 'HTML' is the default format.
18959

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'.
19261

62+
The '-v, --verbose' flag enables verbose logging for debugging purposes.
19363

194-
APPLIES TO
195-
Server
196-
----
197-
====
64+
The '-h, --help' flag prints the help information.
19865

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".
20767

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.
24769

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.)
24972

250-
* The {sqlpp} xref:n1ql:n1ql-language-reference/metafun.adoc#cbqueryreportgen[cbqueryreportgen()] function
251-
* xref:n1ql:n1ql-language-reference/n1ql-error-codes.adoc[]
73+
For more information on AWR, see xref:n1ql:n1ql-manage/query-awr.adoc[ AWR Query].

modules/cli/pages/cli-intro.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ The Server admin tools package lets you install the following Server utilities o
8686
* xref:tools:cbimport.adoc[`cbimport`]
8787
* xref:cli:cbq-tool.adoc[`cbq`]
8888
* xref:cli:cbstats-intro.adoc[`cbstats`]
89+
* xref:cli:cbqueryreportgen.adoc[`cbqueryreportgen`]
8990
* xref:cli:cbcli/couchbase-cli.adoc[`couchbase-cli`]
9091
* xref:cli:mcstat.adoc[`mcstat`]
9192
* xref:cli:mctimings.adoc[`mctimings`]
9293
* xref:cli:mctestauth.adoc[`mctestauth`]
93-
* xref:cli:cbqueryreportgen.adoc[`cbqueryreportgen`]
9494

9595
Download the command line tools package for your platform from the following links:
9696

@@ -123,14 +123,15 @@ The versions of the utilities installed by the tools package are the same as the
123123

124124
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:
125125

126-
* 8.0
127126
* 7.6.0, 7.6.1, 7.6.2, 7.6.3
128127
* 7.2.x
129128
* 7.1.x
130129
* 7.0.x
131130

132131
You can download and use the latest version of the utilities (`cbimport`, `cbexport`, `cbbackupmgr`, and `cbq`) with earlier Couchbase Server versions.
133132

133+
The 'cbqueryreportgen' utility is supported only on Couchbase Server 8.0 and later.
134+
134135
For the Server admin tools package, do the following:
135136

136137
* Use the `--version` option to get the version of the utility. However, for the `cbc` utility, use the `cbc version` option.

0 commit comments

Comments
 (0)