File tree 3 files changed +7
-5
lines changed
libbeat/outputs/elasticsearch
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ https://github.com/elastic/beats/compare/v6.0.0-alpha2...master[Check the HEAD d
74
74
- Add `test output` command, to test Elasticsearch and Logstash output settings. {pull}4590[4590]
75
75
- Introduce configurable event queue settings: queue.mem.events, queue.mem.flush.min_events and queue.mem.flush.timeout. {pull}4650[4650]
76
76
- Enable pipelining in Logstash output by default. {pull}4650[4650]
77
+ - Added 'result' field to Elasticsearch QueryResult struct for compatibility with 6.x Index and Delete API responses. {issue]4661[4661]
77
78
78
79
*Filebeat*
79
80
Original file line number Diff line number Diff line change @@ -14,9 +14,10 @@ type QueryResult struct {
14
14
ID string `json:"_id"`
15
15
Source json.RawMessage `json:"_source"`
16
16
Version int `json:"_version"`
17
- Found bool `json:"found"`
18
17
Exists bool `json:"exists"`
19
- Created bool `json:"created"`
18
+ Found bool `json:"found"` // Only used prior to ES 6. You must also check for Result == "found".
19
+ Created bool `json:"created"` // Only used prior to ES 6. You must also check for Result == "created".
20
+ Result string `json:"result"` // Only used in ES 6+.
20
21
Acknowledged bool `json:"acknowledged"`
21
22
Matches []string `json:"matches"`
22
23
}
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ func TestIndex(t *testing.T) {
36
36
if err != nil {
37
37
t .Fatalf ("Index() returns error: %s" , err )
38
38
}
39
- if ! resp .Created {
40
- t .Errorf ("Index() fails: %s" , resp )
39
+ if ! resp .Created && resp . Result != "created" {
40
+ t .Fatalf ("Index() fails: %s" , resp )
41
41
}
42
42
43
43
params = map [string ]string {
@@ -103,7 +103,7 @@ func TestIngest(t *testing.T) {
103
103
if err != nil {
104
104
t .Fatalf ("Ingest() returns error: %s" , err )
105
105
}
106
- if ! resp .Created {
106
+ if ! resp .Created && resp . Result != "created" {
107
107
t .Errorf ("Ingest() fails: %s" , resp )
108
108
}
109
109
You can’t perform that action at this time.
0 commit comments