Skip to main content
Version: 6.1

Index Operations

Move to ClickHouse

API to initiate the move of a specified index: POST _ism/move_to_click/<index_name>.

Path Parameters

NameTypeDescription
index_namestringThe name of the index to be moved.

Request Body Parameters

NameTypeDescription
connection_idstringThe connection identifier for connecting to ClickHouse, through which the move will be performed.
index_name_patternstringA regular expression pattern for extracting the table name, must contain a named group (?<name>)
fetch_sizeintegerThe batch size for processed documents. The recommended value is between 10000 and 100000 , depending on the document size.
data_scheme_parametersobjectAdditional settings affecting the interaction with the table in ClickHouse.

Scheme data_scheme_parameters

NameTypeDescription
ttl_intervalstringThe Time-To-Live interval for documents in the table, in the format interval <count> <time unit> Available intervals (set for the entire table upon creation).
ttl_columnstringThe name of the datetime-type field used as the basis for TTL calculation.
cluster_namestringThe ClickHouse cluster name (a required field when replication = true or distributed = true).
replicationbooleanFlag indicating whether to create a replicated table during the data transfer (considered if the move initiates the creation of a new table).
distributedbooleanFlag indicating whether to create a distributed table during the data transfer (considered if the move initiates the creation of a new table).
click_server_settingsobjectA key-value map used to pass ClickHouse settings to the client that connects to ClickHouse during data migration.
override_field_typesobjectA map used to override source index field types with ClickHouse types, for example, {"integer_field": "Int64"}. Nested fields are specified using dot notation, for example, human.age. If a parent nested field is overridden, its child fields are not created separately. Instead, the entire value is stored in the parent field as a String containing a JSON structure.
override_field_date_formatsobjectA map used to specify date formats for fields whose values differ from the standard ISO 8601 format. One format can be specified per field, for example, "dd.MM.yyyy HH:mm:ss". After processing, the date is stored in the resulting ClickHouse table in the standard format.
view_json_as_stringbooleanDetermines whether JSON columns are represented as String columns in a VIEW. Required for ClickHouse versions that do not support using JSON columns in a VIEW.
json_fieldsstring[]A list of paths whose child fields are migrated to ClickHouse as a single JSON object. Required for migrating dynamically generated fields, for example, a1, a2, and a3.
blackliststring[]A list of paths that are ignored and not migrated. Path prefixes can be specified, for example, host.*.
whiteliststring[]A list of paths that are migrated even if they match the blacklist. Path prefixes can be specified, for example, host.*.
timestamp_field_namestringThe name of the field that stores the event timestamp. Used when the field name differs from @timestamp.
codecstringThe name of the codec to use as the default codec, for example, ZSTD(3).
table_name_templatestringA template used to rename the target table. It can use the name extracted with index_name_pattern through the {{name}} token, for example, {{name}}-suffix.
source_read_modestringThe source document read mode. Three modes are available: DEFAULT — the default mode, where the source document uses a standard JSON structure; FLAT — used when the source document was indexed in a flattened format, for example, {"user.firstname": "ivan", "user.lastname": "ivanov"}; MIXED — used when some fields were stored in a flattened format and others in a standard nested format.
cb_retries_max_retrieslongThe maximum number of task retry attempts after the Circuit Breaker is triggered. After the limit is exceeded, the task fails.
cb_retries_initial_delay_millislongThe initial delay before the first retry attempt after the Circuit Breaker is triggered. The value is specified in milliseconds.
cb_retries_max_delay_millislongThe maximum delay between retry attempts. The delay increases with each attempt but does not exceed the specified value.

Example Request

POST _ism/move_to_click/clickhouse_test-600006
{
"connection_id": "TestClick",
"index_name_pattern": "(?<name>.*?)-\\d+",
"fetch_size": 100000,
"data_scheme_parameters": {
"ttl_interval": "interval 30 day",
"cluster_name": "sm_cluster",
"replication": true,
"distributed": true,
"click_server_settings": {
"output_format_binary_write_json_as_string": 1,
"input_format_binary_read_json_as_string": 1
},
"override_field_types": {
"integer_field": "Int64",
"object_field.nested_field1.nested_field2": "String"
},
"override_field_date_formats": {
"date_field1": "dd.MM.yyyy HH:mm:ss",
"date_field2": "MM/dd/yyyy hh:mm:ss a"
},
"view_json_as_string": false,
"json_fields": ["EXECVE"],
"blacklist": ["field1", "field2.*"],
"whitelist": ["field2.subfield1"],
"timestamp_field_name": "timestamp",
"codec": "ZSTD(3)",
"table_name_template": "{{name}}-suffix",
"source_read_mode": "MIXED",
"cb_retries_max_retries": 5,
"cb_retries_initial_delay_millis": 3000,
"cb_retries_max_delay_millis": 45000
}
}

API for canceling an active data migration for the specified index: POST _ism/move_to_click/<index_name>/cancel.