kibana/x-pack/plugins
Shaunak Kashyap 84d4b0dc73
Relax check to account for metricbeat-indexed doc format (#23730)
With Metricbeat shipping Elasticsearch monitoring data (instead of internal collection by Elasticsearch), there are some subtle changes to the format of monitoring docs that are indexed into `.monitoring-es-6-*`. One such change is that metricbeat won't index fields with `null` values; instead it simply doesn't index such fields at all.

As a result, in the context of Elasticsearch monitoring docs, when it comes to docs with `type` = `shards` representing unassigned shards, the `shard.node` field was being indexed as `null` by internal Elasticearch collection, whereas the field was absent when the doc was indexed by Metricbeat.

Since both cases represent the same case — the shard being unassigned — this PR relaxes the check in the UI code to look for either case.

### Sample `shards` document indexed by internal ES collection

```js
{
   "_index":".monitoring-es-6-2018.10.02",
   "_type":"doc",
   "_id":"WUf_htOeSXOJQmiesyF5Bw:_na:metricbeat-7.0.0-alpha1-2018.10.01:0:r",
   "_source":{
      "cluster_uuid":"zXO1GjA6SJGsrPnCPkOoyA",
      "timestamp":"2018-10-02T03:54:43.364Z",
      "interval_ms":10000,
      "type":"shards",
      "source_node":null,
      "state_uuid":"WUf_htOeSXOJQmiesyF5Bw",
      "shard":{
         "state":"UNASSIGNED",
         "primary":false,
         "node":null,
         "relocating_node":null,
         "shard":0,
         "index":"metricbeat-7.0.0-alpha1-2018.10.01"
      }
   }
}
```

### Sample `shards` document indexed by Metricbeat collection

```js
{
   "_index":".monitoring-es-6-mb-2018.10.02",
   "_type":"doc",
   "_id":"FhDRTPjkQJqsgawYbxjQzw:_na:metricbeat-7.0.0-alpha1-2018.10.01:0:r",
   "_source":{
      "@timestamp":"2018-10-02T04:00:03.361Z",
      "interval_ms":10000,
      "shard":{
         "state":"UNASSIGNED",
         "primary":false,
         "index":"metricbeat-7.0.0-alpha1-2018.10.01",
         "shard":0
      },
      "state_uuid":"FhDRTPjkQJqsgawYbxjQzw",
      "beat":{
         "hostname":"Shaunaks-MBP-2",
         "version":"7.0.0-alpha1",
         "name":"Shaunaks-MBP-2"
      },
      "timestamp":"2018-10-02T04:00:03.375Z",
      "type":"shards",
      "metricset":{
         "name":"shard",
         "module":"elasticsearch",
         "host":"localhost:9200",
         "rtt":14254,
         "namespace":"elasticsearch.shard"
      },
      "host":{
         "name":"Shaunaks-MBP-2"
      },
      "cluster_uuid":"zXO1GjA6SJGsrPnCPkOoyA"
   }
}
```
2018-10-03 11:49:38 -07:00
..
__mocks__ [APM] ML integration (#19791) 2018-07-04 14:18:19 +02:00
apm Add K7 header navigation (#23300) 2018-10-02 14:09:47 -05:00
canvas Added checks in dom_preview to fix style null bug (#23706) 2018-10-03 09:32:53 -07:00
cloud Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00
console_extensions [DOCS] Updates links to role mapping APIs (#22167) 2018-08-24 09:06:23 -07:00
dashboard_mode Moves styleSheetPath to uiExports (#23007) 2018-09-20 19:01:06 -07:00
graph Add K7 header navigation (#23300) 2018-10-02 14:09:47 -05:00
grokdebugger removes unused less styles for ace editor (#23425) 2018-09-24 15:48:37 -05:00
index_management Update versions of @babel/parser and @babel/types (#23268) 2018-09-25 14:35:31 +03:00
kuery_autocomplete Extract KQL autocomplete to a plugin (#20747) 2018-07-24 12:33:15 -07:00
license_management adding opt in for telemetry to start trial and upload license (#22925) 2018-09-18 10:58:37 -04:00
logstash [Logstash Management] Euify pipeline (#22902) 2018-09-27 16:58:23 -04:00
ml [ML] Indicate multi-bucket anomalies in results dashboards (#23746) 2018-10-03 16:09:52 +01:00
monitoring Relax check to account for metricbeat-indexed doc format (#23730) 2018-10-03 11:49:38 -07:00
notifications Fix misspellings (#19981) 2018-06-26 20:17:41 -07:00
reporting Fixes relative timezone bug #18133 for Chromium reports (#23652) 2018-10-02 14:09:54 -04:00
searchprofiler Search Profiler - convert LESS to SASS (#23588) 2018-10-02 12:30:29 -05:00
security Fix space privilege associations when editing roles (#23638) 2018-10-02 16:45:28 -04:00
spaces Handle case where space name is made entirely of whitespace (#23691) 2018-10-03 12:43:44 -04:00
tilemap Fix misspellings (#19981) 2018-06-26 20:17:41 -07:00
watcher Watcher - convert LESS to SASS (#23252) 2018-10-03 10:56:12 -05:00
xpack_main When we get a 403 trying to get the telemetry document, assume we (#23631) 2018-10-02 09:09:05 -07:00