[fix] JSON Processor was not properly added (#20613)

This commit is contained in:
Tal Levy 2016-09-28 23:04:22 +02:00 committed by GitHub
parent 550a0449bc
commit 92ab44d35c
3 changed files with 51 additions and 9 deletions

View File

@ -62,6 +62,7 @@ public class IngestCommonPlugin extends Plugin implements IngestPlugin {
processors.put(GrokProcessor.TYPE, new GrokProcessor.Factory(builtinPatterns));
processors.put(ScriptProcessor.TYPE, new ScriptProcessor.Factory(parameters.scriptService));
processors.put(DotExpanderProcessor.TYPE, new DotExpanderProcessor.Factory());
processors.put(JsonProcessor.TYPE, new JsonProcessor.Factory());
return Collections.unmodifiableMap(processors);
}

View File

@ -19,12 +19,13 @@
- match: { nodes.$master.ingest.processors.7.type: grok }
- match: { nodes.$master.ingest.processors.8.type: gsub }
- match: { nodes.$master.ingest.processors.9.type: join }
- match: { nodes.$master.ingest.processors.10.type: lowercase }
- match: { nodes.$master.ingest.processors.11.type: remove }
- match: { nodes.$master.ingest.processors.12.type: rename }
- match: { nodes.$master.ingest.processors.13.type: script }
- match: { nodes.$master.ingest.processors.14.type: set }
- match: { nodes.$master.ingest.processors.15.type: sort }
- match: { nodes.$master.ingest.processors.16.type: split }
- match: { nodes.$master.ingest.processors.17.type: trim }
- match: { nodes.$master.ingest.processors.18.type: uppercase }
- match: { nodes.$master.ingest.processors.10.type: json }
- match: { nodes.$master.ingest.processors.11.type: lowercase }
- match: { nodes.$master.ingest.processors.12.type: remove }
- match: { nodes.$master.ingest.processors.13.type: rename }
- match: { nodes.$master.ingest.processors.14.type: script }
- match: { nodes.$master.ingest.processors.15.type: set }
- match: { nodes.$master.ingest.processors.16.type: sort }
- match: { nodes.$master.ingest.processors.17.type: split }
- match: { nodes.$master.ingest.processors.18.type: trim }
- match: { nodes.$master.ingest.processors.19.type: uppercase }

View File

@ -0,0 +1,40 @@
---
teardown:
- do:
ingest.delete_pipeline:
id: "1"
ignore: 404
---
"Test JSON Processor":
- do:
ingest.put_pipeline:
id: "1"
body: >
{
"processors": [
{
"json" : {
"field" : "foo"
}
}
]
}
- match: { acknowledged: true }
- do:
index:
index: test
type: test
id: 1
pipeline: "1"
body: {
foo: "{\"hello\": \"world\"}"
}
- do:
get:
index: test
type: test
id: 1
- match: { _source.foo.hello: "world" }