system-gc-logs
Retrieves JVM GC log entries. Cluster administrator permission is required.
Command properties
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | Cluster administrator |
| License usage | Not counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
Options
fastcheck=BOOL- Quickly scans and outputs only lines that indicate potential GC problems. When set to
t, only lines of type Allocation Stall, To-space Exhausted, and Pause Full are output. (Default:f) duration=INT{mon|w|d|h|m|s}- Limits results to GC logs within the specified time range from the current time. Use units
mon(month),w(week),d(day),h(hour),m(minute), ors(second). For example,10smeans the last 10 seconds relative to query execution time. Cannot be used when bothfromandtooptions are specified. from=DATE- Start time of the retrieval range, in
yyyy[MM[dd[HH[mm[ss]]]]]format. If month, day, etc. are omitted, the earliest possible time is used. The start time is included in the results. to=DATE- End time of the retrieval range, in
yyyy[MM[dd[HH[mm[ss]]]]]format. If month, day, etc. are omitted, the earliest possible time is used. The end time is not included in the results.
Output fields
| Field | Type | Description |
|---|---|---|
| _time | timestamp | GC log timestamp |
| type | string | GC log type. One of ALLOC_STALL, TO_SPACE_EXHAUSTED, FULL_GC, or RAW. |
| duration | double | GC execution time (milliseconds). Returned only for ALLOC_STALL or FULL_GC type. |
| level | string | GC log severity level |
| msg | string | GC log message body. Returned when the log format is [timestamp][level] message. |
| line | string | Original GC log line. Returned for unparseable formats or RAW type. |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 95020 | No read permission. Cluster administrator permission is required. | The user does not have cluster administrator permission |
| 95030 | Invalid from value. | The from option value cannot be parsed as a date |
| 95031 | Invalid to value. | The to option value cannot be parsed as a date |
| 95032 | Invalid from value. | The to value is earlier than the from value |
| 95023 | Cannot use duration option when both from and to options are specified. | duration was used while both from and to were specified |
| 95131 | Invalid fastcheck value: [value] | A non-boolean value was specified for the fastcheck option |
Runtime errors
N/A
Description
The system-gc-logs command reads the JVM GC log file (gc.log) and retrieves GC log entries.
Using the fastcheck=t option, you can quickly retrieve only entries that indicate potential GC problems (Allocation Stall, To-space Exhausted, Pause Full). With fastcheck=t, the type field returns the corresponding type, and if a GC execution time is available, the duration field returns it in milliseconds.
When you specify a time range with the from and to options, only GC log files within that range are selectively read.
Cluster administrator permission is required to run this command.
Examples
-
Retrieve all GC logs
system-gc-logsRetrieves all JVM GC logs.
-
Quickly retrieve only problematic GC entries
system-gc-logs fastcheck=tRetrieves only GC log entries of types Allocation Stall, To-space Exhausted, and Pause Full.
-
Retrieve GC logs from the last hour
system-gc-logs duration=1hRetrieves GC logs from within the last hour.
-
Analyze Full GC frequency
system-gc-logs fastcheck=t duration=1d | search type == "FULL_GC" | stats count() as cnt, avg(duration) as avg_msRetrieves the number of Full GC occurrences and average execution time over the last day.