Skip to content

Commit 92ab44d

Browse files
authored
[fix] JSON Processor was not properly added (#20613)
1 parent 550a044 commit 92ab44d

File tree

3 files changed

+51
-9
lines changed

3 files changed

+51
-9
lines changed

modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/IngestCommonPlugin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public Map<String, Processor.Factory> getProcessors(Processor.Parameters paramet
6262
processors.put(GrokProcessor.TYPE, new GrokProcessor.Factory(builtinPatterns));
6363
processors.put(ScriptProcessor.TYPE, new ScriptProcessor.Factory(parameters.scriptService));
6464
processors.put(DotExpanderProcessor.TYPE, new DotExpanderProcessor.Factory());
65+
processors.put(JsonProcessor.TYPE, new JsonProcessor.Factory());
6566
return Collections.unmodifiableMap(processors);
6667
}
6768

modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
- match: { nodes.$master.ingest.processors.7.type: grok }
2020
- match: { nodes.$master.ingest.processors.8.type: gsub }
2121
- match: { nodes.$master.ingest.processors.9.type: join }
22-
- match: { nodes.$master.ingest.processors.10.type: lowercase }
23-
- match: { nodes.$master.ingest.processors.11.type: remove }
24-
- match: { nodes.$master.ingest.processors.12.type: rename }
25-
- match: { nodes.$master.ingest.processors.13.type: script }
26-
- match: { nodes.$master.ingest.processors.14.type: set }
27-
- match: { nodes.$master.ingest.processors.15.type: sort }
28-
- match: { nodes.$master.ingest.processors.16.type: split }
29-
- match: { nodes.$master.ingest.processors.17.type: trim }
30-
- match: { nodes.$master.ingest.processors.18.type: uppercase }
22+
- match: { nodes.$master.ingest.processors.10.type: json }
23+
- match: { nodes.$master.ingest.processors.11.type: lowercase }
24+
- match: { nodes.$master.ingest.processors.12.type: remove }
25+
- match: { nodes.$master.ingest.processors.13.type: rename }
26+
- match: { nodes.$master.ingest.processors.14.type: script }
27+
- match: { nodes.$master.ingest.processors.15.type: set }
28+
- match: { nodes.$master.ingest.processors.16.type: sort }
29+
- match: { nodes.$master.ingest.processors.17.type: split }
30+
- match: { nodes.$master.ingest.processors.18.type: trim }
31+
- match: { nodes.$master.ingest.processors.19.type: uppercase }
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
teardown:
3+
- do:
4+
ingest.delete_pipeline:
5+
id: "1"
6+
ignore: 404
7+
8+
---
9+
"Test JSON Processor":
10+
- do:
11+
ingest.put_pipeline:
12+
id: "1"
13+
body: >
14+
{
15+
"processors": [
16+
{
17+
"json" : {
18+
"field" : "foo"
19+
}
20+
}
21+
]
22+
}
23+
- match: { acknowledged: true }
24+
25+
- do:
26+
index:
27+
index: test
28+
type: test
29+
id: 1
30+
pipeline: "1"
31+
body: {
32+
foo: "{\"hello\": \"world\"}"
33+
}
34+
35+
- do:
36+
get:
37+
index: test
38+
type: test
39+
id: 1
40+
- match: { _source.foo.hello: "world" }

0 commit comments

Comments
 (0)