File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
x-pack/plugin/apm-data/src
main/resources/ingest-pipelines
yamlRestTest/resources/rest-api-spec/test Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,16 @@ processors:
3030 field : ["event.duration"]
3131 ignore_failure : true
3232 ignore_missing : true
33- - script :
34- if : ctx.event?.outcome == 'success' && ctx[ctx.processor?.event]?.representative_count != null
35- source : |
36- ctx.event.success_count = ctx[ctx.processor?.event]?.representative_count;
3733- set :
3834 if : ctx.event?.outcome == 'failure'
3935 field : event.success_count
4036 value : 0
37+ - set :
38+ if : ctx.event?.outcome == 'success'
39+ field : event.success_count
40+ value : 1
41+ - script :
42+ if : ctx.event?.outcome == 'success' && ctx[ctx.processor?.event]?.representative_count != null
43+ source : ctx.event.success_count = ctx[ctx.processor?.event]?.representative_count;
4144- pipeline :
4245 name : apm@pipeline
Original file line number Diff line number Diff line change @@ -95,6 +95,21 @@ setup:
9595 "span": {"representative_count": 3}
9696 }'
9797
98+ - create : {}
99+ - ' {
100+ "@timestamp": "2017-06-22",
101+ "processor": {"event": "span"},
102+ "event": {"outcome": "success"},
103+ "span": {"representative_count": null}
104+ }'
105+
106+ - create : {}
107+ - ' {
108+ "@timestamp": "2017-06-22",
109+ "processor": {"event": "transaction"},
110+ "event": {"outcome": "success"},
111+ }'
112+
98113 - create : {}
99114 - ' {"@timestamp": "2017-06-22", "event": {"outcome": "failure"}}'
100115
@@ -110,4 +125,6 @@ setup:
110125 - match : { hits.hits.1.fields: null }
111126 - match : { hits.hits.2.fields: {"event.success_count": [2]} }
112127 - match : { hits.hits.3.fields: {"event.success_count": [3]} }
113- - match : { hits.hits.4.fields: {"event.success_count": [0]} }
128+ - match : { hits.hits.4.fields: {"event.success_count": [1]} }
129+ - match : { hits.hits.5.fields: {"event.success_count": [1]} }
130+ - match : { hits.hits.6.fields: {"event.success_count": [0]} }
You can’t perform that action at this time.
0 commit comments