system-indices
Retrieves metadata for indexes created on each table.
Command properties
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | None (table read permission required) |
| License usage | Not counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
Options
verbose={t|f}- Also retrieves storage consumption (
storage_consumption) information. (Default:f)
t: Include storage consumption in the resultsf: Do not retrieve storage consumption
table=TABLE_PATTERN- Table pattern to query. You can specify multiple patterns separated by commas (
,). If not specified, all tables for which you have read permission are queried.
Output fields
| Field | Type | Description |
|---|---|---|
| table | string | Table name |
| index | string | Index name |
| use_bloom_filter | boolean | Whether bloom filter is enabled. true: enabled, false: disabled |
| base_path | string | Index storage path (absolute). Returned only for sessions with cluster administrator permission. |
| tokenizer_name | string | Name of the tokenizer used for index token extraction |
| tokenizer_configs | object | Tokenizer configuration values (e.g., query string) |
| min_index_day | string | Earliest date referenced by the index (yyyy-MM-dd format). Null if not configured. |
| max_index_day | string | Latest date referenced by the index (yyyy-MM-dd format). Null if not configured. |
| indexed_days | string | Date range for which index partitions actually exist (yyyy-MM-dd ~ yyyy-MM-dd format). N/A if none exist. |
| storage_consumption | long | Index storage size (bytes). Returned only when verbose=t is specified. |
| build_past_index | boolean | Whether past data is also indexed when creating the index |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 95101 | invalid-verbose-option | The verbose option value is invalid |
| 95102 | invalid-table-pattern | The table pattern is invalid |
Runtime errors
N/A
Description
The system-indices command retrieves configuration information for indexes on each table. You can view the index name, bloom filter status, tokenizer settings, and indexed date range.
The base_path field is returned only for sessions with cluster administrator permission. The storage_consumption field is returned only when verbose=t is specified and represents the recursive sum of the size of all files and subdirectories in the index directory. In the 4.0 series starting with 4.0.2609.0, if there is a merged index (a .merged directory), its size is included as well, giving a more accurate view of the disk usage the index actually occupies.
Table patterns support wildcards (*) at the beginning or end of the name.
Examples
-
Retrieve index metadata for all tables
system-indicesRetrieves index metadata for all tables for which you have read permission.
-
Retrieve indexes for a specific table
system-indices table=SONAR_EVENTSRetrieves index metadata for the
SONAR_EVENTStable. -
Retrieve with storage consumption included
system-indices verbose=t | eval size_mb = round(storage_consumption / 1048576, 2) | fields table, index, size_mb, indexed_days | sort -size_mbConverts index storage sizes to MB and retrieves them sorted from largest to smallest.
-
Retrieve indexes that use bloom filter
system-indices | search use_bloom_filter == true | fields table, index, tokenizer_name, indexed_daysFilters and retrieves only indexes with bloom filter enabled.
Change history
| Target | Introduced in |
|---|---|
The system-indices command | Before Sonar 4.0 |
Recursive calculation of the storage_consumption field (verbose=t) | 4.0.2609.0 |