Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 6b5c479

Browse files
authored
Replace all target configurations with new variant (#1015)
In #945, a new ("extended") target configuration was introduced: ```yaml target: - a - b ``` instead of `target: [a, b]`. We still maintain compatibility with the old target configuration. However, we should educate users (in our docs) to use the new target configuration. This PR replaces all, internal and external (docs), uses of old target configuration with the new ("extended") target configuration. A new test (`TestTargetLegacyVariant`) is added to make sure we still maintain compatibility with the old way of declaring targets.
1 parent d59a9f2 commit 6b5c479

24 files changed

+400
-158
lines changed

ci/it/configs/quesma-now-reads-clickhouse-tables.yml.template

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ processors:
2525
config:
2626
indexes:
2727
test_table:
28-
target: [ my-clickhouse-instance]
28+
target:
29+
- my-clickhouse-instance
2930
"*":
30-
target: [my-minimal-elasticsearch]
31+
target:
32+
- my-minimal-elasticsearch
3133
pipelines:
3234
- name: my-elasticsearch-proxy-read
3335
frontendConnectors: [ elastic-query ]

ci/it/configs/quesma-wildcard-clickhouse.yml.template

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ processors:
2323
- name: my-query-processor
2424
type: quesma-v1-processor-query
2525
config:
26-
indexes:
26+
indexes:
2727
"*":
28-
target: [ my-clickhouse-instance ]
28+
target:
29+
- my-clickhouse-instance
2930
- name: my-ingest-processor
3031
type: quesma-v1-processor-ingest
3132
config:
3233
indexes:
3334
"*":
34-
target: [ my-clickhouse-instance ]
35+
target: [ my-clickhouse-instance ] # deliberately using legacy way of listing targets here (for better coverage)
3536
pipelines:
3637
- name: my-elasticsearch-proxy-read
3738
frontendConnectors: [ elastic-query ]

ci/it/configs/quesma-wildcard-disabled.yml.template

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,27 @@ processors:
2525
config:
2626
indexes:
2727
"explicitly_disabled1":
28-
target: [ ]
28+
target:
2929
"explicitly_disabled3":
30-
target: [ ]
30+
target:
3131
"query_enabled":
32-
target: [ my-clickhouse-instance ]
32+
target:
33+
- my-clickhouse-instance
3334
"*":
34-
target: [ ]
35+
target:
3536
- name: my-ingest-processor
3637
type: quesma-v1-processor-ingest
3738
config:
3839
indexes:
3940
"explicitly_disabled2":
40-
target: [ ]
41+
target:
4142
"explicitly_disabled3":
42-
target: [ ]
43+
target:
4344
"ingest_enabled":
44-
target: [ my-clickhouse-instance ]
45+
target:
46+
- my-clickhouse-instance
4547
"*":
46-
target: [ ]
48+
target:
4749
pipelines:
4850
- name: my-elasticsearch-proxy-read
4951
frontendConnectors: [ elastic-query ]
@@ -53,4 +55,3 @@ pipelines:
5355
frontendConnectors: [ elastic-ingest ]
5456
processors: [ my-ingest-processor ]
5557
backendConnectors: [ my-minimal-elasticsearch, my-clickhouse-instance ]
56-

ci/it/configs/quesma-with-dual-writes-and-common-table.yml.template

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,20 @@ processors:
2525
config:
2626
indexes:
2727
logs-1:
28-
target: [ e ]
28+
target:
29+
- e
2930
logs-2:
30-
target: [ c ]
31+
target:
32+
- c
3133
logs-3:
32-
target: [ c, e ]
34+
target:
35+
- c
36+
- e
3337
## WARNING `logs-dual-query` (with two dashes) falls under default index pattern for logs in Elasticsearch and results in not index, but datastream creation
3438
logs-dual_query:
35-
target: [ c, e ]
39+
target:
40+
- c
41+
- e
3642
logs-4:
3743
target:
3844
- c:
@@ -42,27 +48,35 @@ processors:
4248
- c:
4349
useCommonTable: true
4450
"*":
45-
target: [ e ]
51+
target:
52+
- e
4653
- name: IP
4754
type: quesma-v1-processor-ingest
4855
config:
4956
indexes:
5057
logs-1:
51-
target: [ e ]
58+
target:
59+
- e
5260
logs-2:
53-
target: [ c ]
61+
target:
62+
- c
5463
logs-3:
55-
target: [ c, e ]
64+
target:
65+
- c
66+
- e
5667
logs-dual_query:
57-
target: [ c, e ]
68+
target:
69+
- c
70+
- e
5871
logs-4:
5972
target:
6073
- c:
6174
useCommonTable: true
6275
logs-5:
6376
target:
6477
"*":
65-
target: [ e ]
78+
target:
79+
- e
6680

6781
pipelines:
6882
- name: my-elasticsearch-proxy-read
@@ -72,4 +86,4 @@ pipelines:
7286
- name: my-elasticsearch-proxy-write
7387
frontendConnectors: [ elastic-ingest ]
7488
processors: [ IP ]
75-
backendConnectors: [ e, c ]
89+
backendConnectors: [ e, c ]

ci/it/configs/quesma-with-two-pipelines.yml.template

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,29 @@ processors:
2525
config:
2626
indexes:
2727
siem:
28-
target: [my-hydrolix-instance]
28+
target:
29+
- my-hydrolix-instance
2930
logs:
30-
target: [my-hydrolix-instance]
31+
target:
32+
- my-hydrolix-instance
3133
test_index:
32-
target: [my-minimal-elasticsearch]
34+
target:
35+
- my-minimal-elasticsearch
3336
"*":
34-
target: [ my-minimal-elasticsearch ]
37+
target:
38+
- my-minimal-elasticsearch
3539
- name: my-ingest-processor
3640
type: quesma-v1-processor-ingest
3741
config:
3842
indexes:
3943
test_index:
40-
target: [ my-minimal-elasticsearch ]
44+
target:
45+
- my-minimal-elasticsearch
4146
logs_disabled:
42-
target: [ ]
47+
target:
4348
"*":
44-
target: [ my-minimal-elasticsearch ]
49+
target:
50+
- my-minimal-elasticsearch
4551
pipelines:
4652
- name: my-elasticsearch-proxy-read
4753
frontendConnectors: [ elastic-query ]
@@ -51,4 +57,3 @@ pipelines:
5157
frontendConnectors: [ elastic-ingest ]
5258
processors: [ my-ingest-processor ]
5359
backendConnectors: [ my-minimal-elasticsearch, my-hydrolix-instance ]
54-

ci/quesma/config/ci-config.yaml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,53 @@ processors:
2424
config:
2525
indexes:
2626
kibana_sample_data_ecommerce:
27-
target: [ my-clickhouse-data-source ]
27+
target:
28+
- my-clickhouse-data-source
2829
kibana_sample_data_flights:
29-
target: [ my-clickhouse-data-source ]
30+
target:
31+
- my-clickhouse-data-source
3032
kibana_sample_data_logs:
31-
target: [ my-clickhouse-data-source ]
33+
target:
34+
- my-clickhouse-data-source
3235
logs-generic-default:
33-
target: [ my-clickhouse-data-source ]
36+
target:
37+
- my-clickhouse-data-source
3438
schemaOverrides:
3539
fields:
3640
"message":
3741
type: text
3842
windows_logs:
39-
target: [ my-clickhouse-data-source ]
43+
target:
44+
- my-clickhouse-data-source
4045
"*":
41-
target: [ my-minimal-elasticsearch ]
46+
target:
47+
- my-minimal-elasticsearch
4248
- name: p2
4349
type: quesma-v1-processor-ingest
4450
config:
4551
indexes:
4652
kibana_sample_data_ecommerce:
47-
target: [ my-clickhouse-data-source ]
53+
target:
54+
- my-clickhouse-data-source
4855
kibana_sample_data_flights:
49-
target: [ my-clickhouse-data-source ]
56+
target:
57+
- my-clickhouse-data-source
5058
kibana_sample_data_logs:
51-
target: [ my-clickhouse-data-source ]
59+
target:
60+
- my-clickhouse-data-source
5261
logs-generic-default:
53-
target: [ my-clickhouse-data-source ]
62+
target:
63+
- my-clickhouse-data-source
5464
schemaOverrides:
5565
fields:
5666
"message":
5767
type: text
5868
windows_logs: # Used for EQL e2e tests
59-
target: [ my-clickhouse-data-source ]
69+
target:
70+
- my-clickhouse-data-source
6071
"*":
61-
target: [ my-minimal-elasticsearch ]
72+
target:
73+
- my-minimal-elasticsearch
6274

6375
pipelines:
6476
- name: p-query

docs/public/docs/compatibility-report.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,19 @@ processors:
1717
config:
1818
indexes:
1919
kibana_sample_data_ecommerce:
20-
target: [ backend-elastic, backend-clickhouse ]
20+
target:
21+
- backend-elastic
22+
- backend-clickhouse
2123
ab_testing_logs:
22-
target: [ backend-clickhouse ]
24+
target:
25+
- backend-clickhouse
2326
- name: my-ingest-processor
2427
type: quesma-v1-processor-ingest
2528
config:
2629
indexes:
2730
ab_testing_logs:
28-
target: [ backend-clickhouse ]
31+
target:
32+
- backend-clickhouse
2933
```
3034
3135
This configuration turns on Compatibility Report for `kibana_sample_data_ecommerce` index. The `ab_testing_logs` is an internal Quesma index which is required in the configuration for Compatibility Report to work properly.

docs/public/docs/config-primer.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,17 @@ processors:
120120
config:
121121
indexes:
122122
kibana_sample_data_ecommerce:
123-
target: [ backend-clickhouse ]
123+
target:
124+
- backend-clickhouse
124125
schemaOverrides:
125126
fields:
126127
"geoip.location":
127128
type: geo_point
128129
"products.product_name":
129130
type: text
130131
"*":
131-
target: [ backend-elastic ]
132+
target:
133+
- backend-elastic
132134
```
133135

134136
To get more specific information on processor configuration, please refer to [Processor configuration](#processor-configuration) section.
@@ -168,15 +170,18 @@ processors:
168170
config:
169171
indexes:
170172
kibana_sample_data_logs:
171-
target: [ backend-elasticsearch ]
173+
target:
174+
- backend-elasticsearch
172175
kibana_sample_data_ecommerce:
173-
target: [ backend-clickhouse ]
176+
target:
177+
- backend-clickhouse
174178
schemaOverrides:
175179
fields:
176180
"geoip.location":
177181
type: geo_point
178182
"*": # Always required
179-
target: [ backend-elasticsearch ]
183+
target:
184+
- backend-elasticsearch
180185
```
181186

182187
### Index configuration
@@ -187,11 +192,13 @@ The configuration for an index consists of the following configuration options:
187192
- `target` (required): a list of backend connectors that will handle the request. For example the following configuration in the ingest processor:
188193
```yaml
189194
my_index:
190-
target: [ backend-elasticsearch, backend-clickhouse ]
195+
target:
196+
- backend-elasticsearch
197+
- backend-clickhouse
191198
```
192199
will dual write ingest requests to `my_index` to both ElasticSearch and ClickHouse.
193200
Note that ElasticSearch/OpenSearch is the only supported backend for the `*` entry.
194-
If no targets are provided (example: `target: []`) in the configuration of an index in the ingest processor, ingest for that index will be disabled and incoming data will be dropped.
201+
If no targets are provided (empty `target` list) in the configuration of an index in the ingest processor, ingest for that index will be disabled and incoming data will be dropped.
195202
For the query processor by specifing multiple targets, [Compatibility report](/compatibility-report.md) will be enabled. See [Compatibility report documentation](/compatibility-report.md) for more details.
196203

197204
Some backend connectors have additional attributes which may be used. For example the following configuration sets `useCommonTable` for `backend-clickhouse` target:
@@ -207,7 +214,8 @@ The configuration for an index consists of the following configuration options:
207214
- `schemaOverrides` (optional): manual overrides of schema information for an index. Quesma infers schema for an index based on the data ingested and the schema information fetched from ClickHouse. `schemaOverrides` allows you to override this inferred schema with for some fields. For example the following configuration:
208215
```yaml
209216
my_index:
210-
target: [ backend-clickhouse ]
217+
target:
218+
- backend-clickhouse
211219
schemaOverrides:
212220
"product_name":
213221
type: "text"

docs/public/docs/example-2-0-clickhouse-specific.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,27 @@ flowchart LR
7272
config:
7373
indexes: # `siem` and `logs` are just examples,
7474
siem: # make sure to replace them with your actual table names in your ClickHouse instance
75-
target: [ clickhouse-instance ]
75+
target:
76+
- clickhouse-instance
7677
logs:
77-
target: [ clickhouse-instance ]
78+
target:
79+
- clickhouse-instance
7880
'*': # DO NOT remove, always required
79-
target: [ minimal-elasticsearch ]
81+
target:
82+
- minimal-elasticsearch
8083
- name: ingest-processor
8184
type: quesma-v1-processor-ingest
8285
config:
8386
indexes: # `siem` and `logs` are just examples,
8487
siem: # make sure to replace them with your actual table or index names in your ClickHouse instance
85-
target: [ clickhouse-instance ]
88+
target:
89+
- clickhouse-instance
8690
logs:
87-
target: [ clickhouse-instance ]
91+
target:
92+
- clickhouse-instance
8893
'*': # DO NOT remove, always required
89-
target: [ minimal-elasticsearch ]
94+
target:
95+
- minimal-elasticsearch
9096
pipelines:
9197
- name: elasticsearch-proxy-read
9298
frontendConnectors: [ elastic-query ]

0 commit comments

Comments
 (0)