Skip to content

Commit 2be837e

Browse files
authored
console: ingest node updates for auto-complete (#24100)
* add bytes processor * add dissect processor * add pipeline processor * add drop processor * add if conditional to each processor * add on_failure to each processor
1 parent 5441d74 commit 2be837e

File tree

1 file changed

+113
-33
lines changed
  • src/core_plugins/console/api_server/es_6_0

1 file changed

+113
-33
lines changed

src/core_plugins/console/api_server/es_6_0/ingest.js

Lines changed: 113 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
* under the License.
1818
*/
1919

20+
const commonPipelineParams = {
21+
on_failure: [],
22+
if: ''
23+
};
24+
2025
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/append-processor.html
2126
const appendProcessorDefinition = {
2227
append: {
@@ -25,7 +30,23 @@ const appendProcessorDefinition = {
2530
value: []
2631
},
2732
field: '',
28-
value: []
33+
value: [],
34+
...commonPipelineParams
35+
}
36+
};
37+
38+
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/bytes-processor.html
39+
const bytesProcessorDefinition = {
40+
bytes: {
41+
__template: {
42+
field: ''
43+
},
44+
field: '',
45+
target_field: '',
46+
ignore_missing: {
47+
__one_of: [ false, true ]
48+
},
49+
...commonPipelineParams
2950
}
3051
};
3152

@@ -43,7 +64,8 @@ const convertProcessorDefinition = {
4364
target_field: '',
4465
ignore_missing: {
4566
__one_of: [ false, true ]
46-
}
67+
},
68+
...commonPipelineParams
4769
}
4870
};
4971

@@ -58,7 +80,8 @@ const dateProcessorDefinition = {
5880
target_field: '@timestamp',
5981
formats: [],
6082
timezone: 'UTC',
61-
locale: 'ENGLISH'
83+
locale: 'ENGLISH',
84+
...commonPipelineParams
6285
}
6386
};
6487

@@ -76,7 +99,45 @@ const dateIndexNameProcessorDefinition = {
7699
date_formats: [],
77100
timezone: 'UTC',
78101
locale: 'ENGLISH',
79-
index_name_format: 'yyyy-MM-dd'
102+
index_name_format: 'yyyy-MM-dd',
103+
...commonPipelineParams
104+
}
105+
};
106+
107+
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/dissect-processor.html
108+
const dissectProcessorDefinition = {
109+
dissect: {
110+
__template: {
111+
field: '',
112+
pattern: ''
113+
},
114+
field: '',
115+
pattern: '',
116+
append_separator: '',
117+
ignore_missing: {
118+
__one_of: [ false, true ]
119+
},
120+
...commonPipelineParams
121+
}
122+
};
123+
124+
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/dot-expand-processor.html
125+
const dotExpanderProcessorDefinition = {
126+
dot_expander: {
127+
__template: {
128+
field: ''
129+
},
130+
field: '',
131+
path: '',
132+
...commonPipelineParams
133+
}
134+
};
135+
136+
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/drop-processor.html
137+
const dropProcessorDefinition = {
138+
drop: {
139+
__template: {},
140+
...commonPipelineParams
80141
}
81142
};
82143

@@ -86,7 +147,8 @@ const failProcessorDefinition = {
86147
__template: {
87148
message: ''
88149
},
89-
message: ''
150+
message: '',
151+
...commonPipelineParams
90152
}
91153
};
92154

@@ -100,7 +162,8 @@ const foreachProcessorDefinition = {
100162
field: '',
101163
processor: {
102164
__scope_link: '_processor'
103-
}
165+
},
166+
...commonPipelineParams
104167
}
105168
};
106169

@@ -119,7 +182,8 @@ const grokProcessorDefinition = {
119182
},
120183
ignore_missing: {
121184
__one_of: [ false, true ]
122-
}
185+
},
186+
...commonPipelineParams
123187
}
124188
};
125189

@@ -133,7 +197,8 @@ const gsubProcessorDefinition = {
133197
},
134198
field: '',
135199
pattern: '',
136-
replacement: ''
200+
replacement: '',
201+
...commonPipelineParams
137202
}
138203
};
139204

@@ -145,7 +210,8 @@ const joinProcessorDefinition = {
145210
separator: ''
146211
},
147212
field: '',
148-
separator: ''
213+
separator: '',
214+
...commonPipelineParams
149215
}
150216
};
151217

@@ -159,7 +225,8 @@ const jsonProcessorDefinition = {
159225
target_field: '',
160226
add_to_root: {
161227
__one_of: [ false, true ]
162-
}
228+
},
229+
...commonPipelineParams
163230
}
164231
};
165232

@@ -178,7 +245,8 @@ const kvProcessorDefinition = {
178245
include_keys: [],
179246
ignore_missing: {
180247
__one_of: [ false, true ]
181-
}
248+
},
249+
...commonPipelineParams
182250
}
183251
};
184252

@@ -191,7 +259,19 @@ const lowercaseProcessorDefinition = {
191259
field: '',
192260
ignore_missing: {
193261
__one_of: [ false, true ]
194-
}
262+
},
263+
...commonPipelineParams
264+
}
265+
};
266+
267+
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline-processor.html
268+
const pipelineProcessorDefinition = {
269+
pipeline: {
270+
__template: {
271+
pipeline: ''
272+
},
273+
pipeline: '',
274+
...commonPipelineParams
195275
}
196276
};
197277

@@ -201,7 +281,8 @@ const removeProcessorDefinition = {
201281
__template: {
202282
field: ''
203283
},
204-
field: ''
284+
field: '',
285+
...commonPipelineParams
205286
}
206287
};
207288

@@ -216,7 +297,8 @@ const renameProcessorDefinition = {
216297
target_field: '',
217298
ignore_missing: {
218299
__one_of: [ false, true ]
219-
}
300+
},
301+
...commonPipelineParams
220302
}
221303
};
222304

@@ -228,7 +310,8 @@ const scriptProcessorDefinition = {
228310
file: '',
229311
id: '',
230312
inline: '',
231-
params: {}
313+
params: {},
314+
...commonPipelineParams
232315
}
233316
};
234317

@@ -243,7 +326,8 @@ const setProcessorDefinition = {
243326
value: '',
244327
override: {
245328
__one_of: [ true, false ]
246-
}
329+
},
330+
...commonPipelineParams
247331
}
248332
};
249333

@@ -258,7 +342,8 @@ const splitProcessorDefinition = {
258342
separator: '',
259343
ignore_missing: {
260344
__one_of: [ false, true ]
261-
}
345+
},
346+
...commonPipelineParams
262347
}
263348
};
264349

@@ -269,7 +354,8 @@ const sortProcessorDefinition = {
269354
field: ''
270355
},
271356
field: '',
272-
order: 'asc'
357+
order: 'asc',
358+
...commonPipelineParams
273359
}
274360
};
275361

@@ -282,7 +368,8 @@ const trimProcessorDefinition = {
282368
field: '',
283369
ignore_missing: {
284370
__one_of: [ false, true ]
285-
}
371+
},
372+
...commonPipelineParams
286373
}
287374
};
288375

@@ -295,27 +382,21 @@ const uppercaseProcessorDefinition = {
295382
field: '',
296383
ignore_missing: {
297384
__one_of: [ false, true ]
298-
}
299-
}
300-
};
301-
302-
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/dot-expand-processor.html
303-
const dotExpanderProcessorDefinition = {
304-
dot_expander: {
305-
__template: {
306-
field: ''
307385
},
308-
field: '',
309-
path: ''
386+
...commonPipelineParams
310387
}
311388
};
312389

313390
const processorDefinition = {
314391
__one_of: [
315392
appendProcessorDefinition,
393+
bytesProcessorDefinition,
316394
convertProcessorDefinition,
317395
dateProcessorDefinition,
318396
dateIndexNameProcessorDefinition,
397+
dissectProcessorDefinition,
398+
dotExpanderProcessorDefinition,
399+
dropProcessorDefinition,
319400
failProcessorDefinition,
320401
foreachProcessorDefinition,
321402
grokProcessorDefinition,
@@ -324,15 +405,15 @@ const processorDefinition = {
324405
jsonProcessorDefinition,
325406
kvProcessorDefinition,
326407
lowercaseProcessorDefinition,
408+
pipelineProcessorDefinition,
327409
removeProcessorDefinition,
328410
renameProcessorDefinition,
329411
scriptProcessorDefinition,
330412
setProcessorDefinition,
331413
splitProcessorDefinition,
332414
sortProcessorDefinition,
333415
trimProcessorDefinition,
334-
uppercaseProcessorDefinition,
335-
dotExpanderProcessorDefinition
416+
uppercaseProcessorDefinition
336417
]
337418
};
338419

@@ -344,7 +425,6 @@ const pipelineDefinition = {
344425
version: 123,
345426
};
346427

347-
348428
export default function (api) {
349429

350430
// Note: this isn't an actual API endpoint. It exists so the forEach processor's "processor" field

0 commit comments

Comments
 (0)