diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index d2fbbf147efd..688c256d3088 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -5405,13 +5405,22 @@ "monitor_name_stats": { "properties": { "avg_length": { - "type": "float" + "type": "float", + "_meta": { + "description": "This field represents the average length of monitor names" + } }, "max_length": { - "type": "long" + "type": "long", + "_meta": { + "description": "This field represents the max length of monitor names" + } }, "min_length": { - "type": "long" + "type": "long", + "_meta": { + "description": "This field represents the min length of monitor names" + } } } }, @@ -5419,21 +5428,36 @@ "type": "long" }, "no_of_unique_monitors": { - "type": "long" + "type": "long", + "_meta": { + "description": "This field represents the number of unique configured monitors" + } }, "no_of_unique_observer_locations": { - "type": "long" + "type": "long", + "_meta": { + "description": "This field represents the number of unique monitor observer locations" + } }, "observer_location_name_stats": { "properties": { "avg_length": { - "type": "float" + "type": "float", + "_meta": { + "description": "This field represents the average length of monitor observer location names" + } }, "max_length": { - "type": "long" + "type": "long", + "_meta": { + "description": "This field represents the max length of monitor observer location names" + } }, "min_length": { - "type": "long" + "type": "long", + "_meta": { + "description": "This field represents the min length of monitor observer location names" + } } } }, @@ -5442,6 +5466,43 @@ }, "settings_page": { "type": "long" + }, + "fleet_monitor_name_stats": { + "properties": { + "avg_length": { + "type": "float", + "_meta": { + "description": "This field represents the average length of fleet managed monitor names" + } + }, + "max_length": { + "type": "long", + "_meta": { + "description": "This field represents the max length of fleet managed monitor names" + } + }, + "min_length": { + "type": "long", + "_meta": { + "description": "This field represents the min length of fleet managed monitor names" + } + } + } + }, + "fleet_monitor_frequency": { + "type": "array", + "items": { + "type": "long", + "_meta": { + "description": "This field represents the average the monitor frequency of fleet managed monitors" + } + } + }, + "fleet_no_of_unique_monitors": { + "type": "long", + "_meta": { + "description": "This field represents the number of unique configured fleet managed monitors" + } } } } diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/__snapshots__/kibana_telemetry_adapter.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__snapshots__/kibana_telemetry_adapter.test.ts.snap index 8c55d5da54ac..9148887ae4f8 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/__snapshots__/kibana_telemetry_adapter.test.ts.snap +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__snapshots__/kibana_telemetry_adapter.test.ts.snap @@ -14,6 +14,13 @@ Object { "dateRangeStart": Array [ "now-15", ], + "fleet_monitor_frequency": Array [], + "fleet_monitor_name_stats": Object { + "avg_length": 0, + "max_length": 0, + "min_length": 0, + }, + "fleet_no_of_unique_monitors": 0, "monitor_frequency": Array [], "monitor_name_stats": Object { "avg_length": 0, @@ -49,6 +56,13 @@ Object { "dateRangeStart": Array [ "now-15", ], + "fleet_monitor_frequency": Array [], + "fleet_monitor_name_stats": Object { + "avg_length": 0, + "max_length": 0, + "min_length": 0, + }, + "fleet_no_of_unique_monitors": 0, "monitor_frequency": Array [], "monitor_name_stats": Object { "avg_length": 0, diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.test.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.test.ts index 06a14b30bdae..70385698ca6e 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.test.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.test.ts @@ -27,7 +27,9 @@ describe('KibanaTelemetryAdapter', () => { }, }; getSavedObjectsClient = () => { - return {}; + return { + get: () => {}, + }; }; collectorFetchContext = createCollectorFetchContextMock(); }); diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts index e540909b505c..631bcf1b245d 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts @@ -52,20 +52,104 @@ export class KibanaTelemetryAdapter { dateRangeStart: { type: 'array', items: { type: 'date' } }, monitor_frequency: { type: 'array', items: { type: 'long' } }, monitor_name_stats: { - avg_length: { type: 'float' }, - max_length: { type: 'long' }, - min_length: { type: 'long' }, + avg_length: { + type: 'float', + _meta: { + description: 'This field represents the average length of monitor names', + }, + }, + max_length: { + type: 'long', + _meta: { + description: 'This field represents the max length of monitor names', + }, + }, + min_length: { + type: 'long', + _meta: { + description: 'This field represents the min length of monitor names', + }, + }, }, monitor_page: { type: 'long' }, - no_of_unique_monitors: { type: 'long' }, - no_of_unique_observer_locations: { type: 'long' }, + no_of_unique_monitors: { + type: 'long', + _meta: { + description: 'This field represents the number of unique configured monitors', + }, + }, + no_of_unique_observer_locations: { + type: 'long', + _meta: { + description: + 'This field represents the number of unique monitor observer locations', + }, + }, observer_location_name_stats: { - avg_length: { type: 'float' }, - max_length: { type: 'long' }, - min_length: { type: 'long' }, + avg_length: { + type: 'float', + _meta: { + description: + 'This field represents the average length of monitor observer location names', + }, + }, + max_length: { + type: 'long', + _meta: { + description: + 'This field represents the max length of monitor observer location names', + }, + }, + min_length: { + type: 'long', + _meta: { + description: + 'This field represents the min length of monitor observer location names', + }, + }, }, overview_page: { type: 'long' }, settings_page: { type: 'long' }, + fleet_monitor_name_stats: { + avg_length: { + type: 'float', + _meta: { + description: + 'This field represents the average length of fleet managed monitor names', + }, + }, + max_length: { + type: 'long', + _meta: { + description: + 'This field represents the max length of fleet managed monitor names', + }, + }, + min_length: { + type: 'long', + _meta: { + description: + 'This field represents the min length of fleet managed monitor names', + }, + }, + }, + fleet_monitor_frequency: { + type: 'array', + items: { + type: 'long', + _meta: { + description: + 'This field represents the average the monitor frequency of fleet managed monitors', + }, + }, + }, + fleet_no_of_unique_monitors: { + type: 'long', + _meta: { + description: + 'This field represents the number of unique configured fleet managed monitors', + }, + }, }, }, }, @@ -74,6 +158,7 @@ export class KibanaTelemetryAdapter { if (savedObjectsClient) { const uptimeEsClient = createUptimeESClient({ esClient, savedObjectsClient }); await this.countNoOfUniqueMonitorAndLocations(uptimeEsClient, savedObjectsClient); + await this.countNoOfUniqueFleetManagedMonitors(uptimeEsClient); } const report = this.getReport(); return { last_24_hours: { hits: { ...report } } }; @@ -218,6 +303,79 @@ export class KibanaTelemetryAdapter { return bucket; } + public static async countNoOfUniqueFleetManagedMonitors(callCluster: UptimeESClient) { + const params = { + index: 'synthetics-*', + body: { + query: { + bool: { + must: [ + { + range: { + '@timestamp': { + gte: 'now-1d/d', + lt: 'now', + }, + }, + }, + { + term: { + 'monitor.fleet_managed': true, + }, + }, + ], + }, + }, + size: 0, + aggs: { + unique_monitors: { + cardinality: { + field: 'monitor.id', + }, + }, + monitor_name: { + string_stats: { + field: 'monitor.name', + }, + }, + monitors: { + terms: { + field: 'monitor.id', + size: 1000, + }, + aggs: { + docs: { + top_hits: { + size: 1, + _source: ['monitor.timespan'], + }, + }, + }, + }, + }, + }, + }; + + const { body: result } = await callCluster.search(params); + + const numberOfUniqueMonitors: number = result?.aggregations?.unique_monitors?.value ?? 0; + const monitorNameStats = result?.aggregations?.monitor_name; + const uniqueMonitors: any = result?.aggregations?.monitors.buckets; + + const bucketId = this.getBucketToIncrement(); + const bucket = this.collector[bucketId]; + + bucket.fleet_no_of_unique_monitors = numberOfUniqueMonitors; + bucket.fleet_monitor_name_stats = { + min_length: monitorNameStats?.min_length ?? 0, + max_length: monitorNameStats?.max_length ?? 0, + avg_length: +(monitorNameStats?.avg_length?.toFixed(2) ?? 0), + }; + + bucket.fleet_monitor_frequency = this.getMonitorsFrequency(uniqueMonitors); + return bucket; + } + private static getMonitorsFrequency(uniqueMonitors = []) { const frequencies: number[] = []; uniqueMonitors @@ -285,6 +443,14 @@ export class KibanaTelemetryAdapter { dateRangeEnd: [], autoRefreshEnabled: false, autorefreshInterval: [], + + fleet_no_of_unique_monitors: 0, + fleet_monitor_frequency: [], + fleet_monitor_name_stats: { + min_length: 0, + max_length: 0, + avg_length: 0, + }, }; } return bucketId; diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/types.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/types.ts index 632544a5c2d3..eceee3505dd7 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/types.ts @@ -40,4 +40,8 @@ export interface UptimeTelemetry { dateRangeEnd: string[]; autorefreshInterval: number[]; autoRefreshEnabled: boolean; + + fleet_no_of_unique_monitors: number; + fleet_monitor_frequency: number[]; + fleet_monitor_name_stats: Stats; } diff --git a/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts index ef1e0a07c639..088cf494efbf 100644 --- a/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts +++ b/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts @@ -34,6 +34,7 @@ export const createLogPageViewRoute: UMRestApiRouteFactory = () => ({ uptimeEsClient, savedObjectsClient ); + await KibanaTelemetryAdapter.countNoOfUniqueFleetManagedMonitors(uptimeEsClient); return KibanaTelemetryAdapter.countPageView(pageView as PageViewParams); }, }); diff --git a/x-pack/test/api_integration/apis/uptime/rest/helper/make_checks.ts b/x-pack/test/api_integration/apis/uptime/rest/helper/make_checks.ts index c8b1434b6ffd..829ae07eccf2 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/helper/make_checks.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/helper/make_checks.ts @@ -18,6 +18,7 @@ interface CheckProps { mogrify?: (doc: any) => any; refresh?: boolean; tls?: boolean | TlsProps; + isFleetManaged?: boolean; } const getRandomMonitorId = () => { @@ -31,6 +32,7 @@ export const makeCheck = async ({ mogrify = (d) => d, refresh = true, tls = false, + isFleetManaged = false, }: CheckProps): Promise<{ monitorId: string; docs: any }> => { const cgFields = { monitor: { @@ -52,7 +54,15 @@ export const makeCheck = async ({ if (i === numIps - 1) { pingFields.summary = summary; } - const doc = await makePing(es, monitorId, pingFields, mogrify, false, tls as any); + const doc = await makePing( + es, + monitorId, + pingFields, + mogrify, + false, + tls as any, + isFleetManaged + ); docs.push(doc); // @ts-ignore summary[doc.monitor.status]++; @@ -73,7 +83,8 @@ export const makeChecks = async ( every: number = 10000, // number of millis between checks fields: { [key: string]: any } = {}, mogrify: (doc: any) => any = (d) => d, - refresh: boolean = true + refresh: boolean = true, + isFleetManaged: boolean = false ) => { const checks = []; const oldestTime = new Date().getTime() - numChecks * every; @@ -90,7 +101,15 @@ export const makeChecks = async ( }, }, }); - const { docs } = await makeCheck({ es, monitorId, numIps, fields, mogrify, refresh: false }); + const { docs } = await makeCheck({ + es, + monitorId, + numIps, + fields, + mogrify, + refresh: false, + isFleetManaged, + }); checks.push(docs); } @@ -110,7 +129,8 @@ export const makeChecksWithStatus = async ( fields: { [key: string]: any } = {}, status: 'up' | 'down', mogrify: (doc: any) => any = (d) => d, - refresh: boolean = true + refresh: boolean = true, + isFleetManaged: boolean = false ) => { const oppositeStatus = status === 'up' ? 'down' : 'up'; @@ -130,7 +150,8 @@ export const makeChecksWithStatus = async ( return mogrify(d); }, - refresh + refresh, + isFleetManaged ); }; diff --git a/x-pack/test/api_integration/apis/uptime/rest/helper/make_ping.ts b/x-pack/test/api_integration/apis/uptime/rest/helper/make_ping.ts index f6ce4246f0a2..c45f68e4ae0c 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/helper/make_ping.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/helper/make_ping.ts @@ -9,7 +9,8 @@ import uuid from 'uuid'; import { merge } from 'lodash'; import { makeTls, TlsProps } from './make_tls'; -const INDEX_NAME = 'heartbeat-8-generated-test'; +const DEFAULT_INDEX_NAME = 'heartbeat-8-generated-test'; +const DATA_STREAM_INDEX_NAME = 'synthetics-http-default'; export const makePing = async ( es: any, @@ -17,7 +18,8 @@ export const makePing = async ( fields: { [key: string]: any }, mogrify: (doc: any) => any, refresh: boolean = true, - tls: boolean | TlsProps = false + tls: boolean | TlsProps = false, + isFleetManaged: boolean | undefined = false ) => { const timestamp = new Date(); const baseDoc: any = { @@ -115,7 +117,7 @@ export const makePing = async ( const doc = mogrify(merge(baseDoc, fields)); await es.index({ - index: INDEX_NAME, + index: isFleetManaged ? DATA_STREAM_INDEX_NAME : DEFAULT_INDEX_NAME, refresh, body: doc, }); diff --git a/x-pack/test/api_integration/apis/uptime/rest/index.ts b/x-pack/test/api_integration/apis/uptime/rest/index.ts index a46aa653b6f2..9f90d3739797 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/index.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/index.ts @@ -38,14 +38,21 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { }); describe('with generated data', () => { - beforeEach('load heartbeat data', async () => await esArchiver.loadIfNeeded('uptime/blank')); - after('unload', async () => await esArchiver.unload('uptime/blank')); + beforeEach('load heartbeat data', async () => { + await esArchiver.loadIfNeeded('uptime/blank'); + await esArchiver.loadIfNeeded('uptime/blank_data_stream'); + }); + after('unload', async () => { + await esArchiver.unload('uptime/blank'); + await esArchiver.unload('uptime/blank_data_stream'); + }); loadTestFile(require.resolve('./certs')); loadTestFile(require.resolve('./dynamic_settings')); loadTestFile(require.resolve('./snapshot')); loadTestFile(require.resolve('./monitor_states_generated')); loadTestFile(require.resolve('./telemetry_collectors')); + loadTestFile(require.resolve('./telemetry_collectors_fleet')); }); describe('with real-world data', () => { diff --git a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts index e528ab6719fe..f0f7a520d098 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts @@ -14,7 +14,7 @@ export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const es = getService('legacyEs'); - describe('telemetry collectors', () => { + describe('telemetry collectors heartbeat', () => { before('generating data', async () => { await getService('esArchiver').load('uptime/blank'); @@ -82,7 +82,9 @@ export default function ({ getService }: FtrProviderContext) { await es.indices.refresh(); }); - after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank')); + after('unload heartbeat index', () => { + getService('esArchiver').unload('uptime/blank'); + }); beforeEach(async () => { await es.indices.refresh(); @@ -116,6 +118,13 @@ export default function ({ getService }: FtrProviderContext) { dateRangeEnd: ['now/d'], autoRefreshEnabled: true, autorefreshInterval: [100], + fleet_monitor_frequency: [], + fleet_monitor_name_stats: { + avg_length: 0, + max_length: 0, + min_length: 0, + }, + fleet_no_of_unique_monitors: 0, }); }); diff --git a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts new file mode 100644 index 000000000000..8c462f1db431 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts @@ -0,0 +1,191 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; +import { makeChecksWithStatus } from './helper/make_checks'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const es = getService('legacyEs'); + const client = getService('es'); + + describe('telemetry collectors fleet', () => { + before('generating data', async () => { + await getService('esArchiver').load('uptime/blank_data_stream'); + + const observer = { + geo: { + name: 'US-East', + location: '40.7128, -74.0060', + }, + }; + + const observer2 = { + geo: { + name: 'US', + location: '40.7128, -74.0060', + }, + }; + + await makeChecksWithStatus( + es, + 'upMonitorId', + 1, + 1, + 60 * 1000, + { + observer: {}, + monitor: { + name: 'Elastic', + fleet_managed: true, + }, + }, + 'up', + undefined, + undefined, + true + ); + + await makeChecksWithStatus( + es, + 'downMonitorId', + 1, + 1, + 120 * 1000, + { + observer, + monitor: { + name: 'Long Name with 22 Char', + fleet_managed: true, + }, + }, + 'down', + undefined, + undefined, + true + ); + + await makeChecksWithStatus( + es, + 'noGeoNameMonitor', + 1, + 1, + 60 * 1000, + { + observer: {}, + monitor: { + fleet_managed: true, + }, + }, + 'down', + undefined, + undefined, + true + ); + await makeChecksWithStatus( + es, + 'downMonitorId', + 1, + 1, + 1, + { + observer, + monitor: { + name: 'Elastic', + fleet_managed: true, + }, + }, + 'down', + undefined, + undefined, + true + ); + + await makeChecksWithStatus( + es, + 'mixMonitorId', + 1, + 1, + 1, + { observer: observer2, monitor: { fleet_managed: true } }, + 'down', + undefined, + undefined, + true + ); + await es.indices.refresh(); + }); + + after('unload heartbeat index', () => { + getService('esArchiver').unload('uptime/blank_data_stream'); + /** + * Data streams aren't included in the javascript elasticsearch client in kibana yet so we + * need to do raw requests here. Delete a data stream is slightly different than that of a regular index which + * is why we're using _data_stream here. + */ + client.transport.request({ + method: 'DELETE', + path: `_data_stream/synthetics-http-default`, + }); + }); + + beforeEach(async () => { + await es.indices.refresh(); + }); + + it('should receive expected results for fleet managed monitors after calling monitor logging', async () => { + // call monitor page + const { body: result } = await supertest + .post(API_URLS.LOG_PAGE_VIEW) + .set('kbn-xsrf', 'true') + .send({ + page: 'Monitor', + autorefreshInterval: 100, + dateStart: 'now/d', + dateEnd: 'now/d', + autoRefreshEnabled: true, + refreshTelemetryHistory: true, + }) + .expect(200); + + expect(result).to.eql({ + overview_page: 0, + monitor_page: 1, + no_of_unique_monitors: 4, + settings_page: 0, + monitor_frequency: [120, 0.001, 60, 60], + monitor_name_stats: { min_length: 7, max_length: 22, avg_length: 12 }, + no_of_unique_observer_locations: 3, + observer_location_name_stats: { min_length: 2, max_length: 7, avg_length: 4.8 }, + dateRangeStart: ['now/d'], + dateRangeEnd: ['now/d'], + autoRefreshEnabled: true, + autorefreshInterval: [100], + fleet_monitor_frequency: [120, 0.001, 60, 60], + fleet_monitor_name_stats: { min_length: 7, max_length: 22, avg_length: 12 }, + fleet_no_of_unique_monitors: 4, + }); + }); + + it('should receive 200 status after overview logging', async () => { + // call overview page + await supertest + .post(API_URLS.LOG_PAGE_VIEW) + .set('kbn-xsrf', 'true') + .send({ + page: 'Overview', + autorefreshInterval: 60, + dateStart: 'now/d', + dateEnd: 'now-30', + autoRefreshEnabled: true, + }) + .expect(200); + }); + }); +} diff --git a/x-pack/test/functional/es_archives/uptime/blank_data_stream/data.json b/x-pack/test/functional/es_archives/uptime/blank_data_stream/data.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/x-pack/test/functional/es_archives/uptime/blank_data_stream/mappings.json b/x-pack/test/functional/es_archives/uptime/blank_data_stream/mappings.json new file mode 100644 index 000000000000..4b1c109e4385 --- /dev/null +++ b/x-pack/test/functional/es_archives/uptime/blank_data_stream/mappings.json @@ -0,0 +1,1333 @@ +{ + "type": "index", + "value": { + "aliases": {}, + "index": ".ds-synthetics-http-default-2021.04.20-000001", + "mappings": { + "_data_stream_timestamp": { + "enabled": true + }, + "_meta": { + "managed": true, + "managed_by": "ingest-manager", + "package": { + "name": "synthetics" + } + }, + "date_detection": false, + "dynamic_templates": [ + { + "strings_as_keyword": { + "mapping": { + "ignore_above": 1024, + "type": "keyword" + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "build": { + "properties": { + "original": { + "type": "wildcard" + } + } + }, + "ephemeral_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "cloud": { + "properties": { + "account": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "availability_zone": { + "ignore_above": 1024, + "type": "keyword" + }, + "image": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "instance": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "machine": { + "properties": { + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "project": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "provider": { + "ignore_above": 1024, + "type": "keyword" + }, + "region": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "container": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "image": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "tag": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "labels": { + "type": "object" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "runtime": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "data_stream": { + "properties": { + "dataset": { + "type": "constant_keyword" + }, + "namespace": { + "type": "constant_keyword" + }, + "type": { + "type": "constant_keyword" + } + } + }, + "dataset": { + "properties": { + "name": { + "type": "constant_keyword" + }, + "namespace": { + "type": "constant_keyword" + }, + "type": { + "type": "constant_keyword" + } + } + }, + "dns": { + "properties": { + "answers": { + "properties": { + "class": { + "ignore_above": 1024, + "type": "keyword" + }, + "data": { + "type": "wildcard" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "ttl": { + "type": "long" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "header_flags": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "op_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "question": { + "properties": { + "class": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "type": "wildcard" + }, + "registered_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "subdomain": { + "ignore_above": 1024, + "type": "keyword" + }, + "top_level_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "resolved_ip": { + "type": "ip" + }, + "response_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "docker": { + "properties": { + "container": { + "properties": { + "labels": { + "type": "object" + } + } + } + } + }, + "ecs": { + "properties": { + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "error": { + "properties": { + "code": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "message": { + "type": "text" + }, + "stack_trace": { + "type": "wildcard" + }, + "type": { + "type": "wildcard" + } + } + }, + "event": { + "properties": { + "dataset": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "fields": { + "type": "object" + }, + "http": { + "properties": { + "request": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "type": "wildcard" + } + } + }, + "bytes": { + "type": "long" + }, + "method": { + "ignore_above": 1024, + "type": "keyword" + }, + "mime_type": { + "ignore_above": 1024, + "type": "keyword" + }, + "referrer": { + "type": "wildcard" + } + } + }, + "response": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "type": "wildcard" + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "bytes": { + "type": "long" + }, + "headers": { + "properties": { + "*": { + "enabled": false, + "type": "object" + }, + "Cache-Control": { + "ignore_above": 1024, + "type": "keyword" + }, + "Content-Length": { + "ignore_above": 1024, + "type": "keyword" + }, + "Content-Type": { + "ignore_above": 1024, + "type": "keyword" + }, + "Date": { + "ignore_above": 1024, + "type": "keyword" + }, + "Location": { + "ignore_above": 1024, + "type": "keyword" + }, + "Referrer-Policy": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "mime_type": { + "ignore_above": 1024, + "type": "keyword" + }, + "redirects": { + "ignore_above": 1024, + "type": "keyword" + }, + "status_code": { + "type": "long" + } + } + }, + "rtt": { + "properties": { + "content": { + "properties": { + "us": { + "type": "long" + } + } + }, + "response_header": { + "properties": { + "us": { + "type": "long" + } + } + }, + "total": { + "properties": { + "us": { + "type": "long" + } + } + }, + "validate": { + "properties": { + "us": { + "type": "long" + } + } + }, + "validate_body": { + "properties": { + "us": { + "type": "long" + } + } + }, + "write_request": { + "properties": { + "us": { + "type": "long" + } + } + } + } + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "jolokia": { + "properties": { + "agent": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "secured": { + "type": "boolean" + }, + "server": { + "properties": { + "product": { + "ignore_above": 1024, + "type": "keyword" + }, + "vendor": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "url": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "kubernetes": { + "properties": { + "annotations": { + "properties": { + "*": { + "type": "object" + } + } + }, + "container": { + "properties": { + "image": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "deployment": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "labels": { + "properties": { + "*": { + "type": "object" + } + } + }, + "namespace": { + "ignore_above": 1024, + "type": "keyword" + }, + "node": { + "properties": { + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "pod": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "uid": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "replicaset": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "statefulset": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "labels": { + "type": "object" + }, + "monitor": { + "properties": { + "check_group": { + "ignore_above": 1024, + "type": "keyword" + }, + "duration": { + "properties": { + "us": { + "type": "long" + } + } + }, + "fleet_managed": { + "type": "boolean" + }, + "id": { + "fields": { + "text": { + "analyzer": "simple", + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "name": { + "fields": { + "text": { + "analyzer": "simple", + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "timespan": { + "type": "date_range" + }, + "type": { + "type": "constant_keyword", + "value": "http" + } + } + }, + "observer": { + "properties": { + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "type": "wildcard" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "type": "wildcard" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "type": "wildcard" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "product": { + "ignore_above": 1024, + "type": "keyword" + }, + "serial_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "vendor": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "resolve": { + "properties": { + "ip": { + "type": "ip" + }, + "rtt": { + "properties": { + "us": { + "type": "long" + } + } + } + } + }, + "socks5": { + "properties": { + "rtt": { + "properties": { + "connect": { + "properties": { + "us": { + "type": "long" + } + } + } + } + } + } + }, + "summary": { + "properties": { + "down": { + "type": "long" + }, + "up": { + "type": "long" + } + } + }, + "tags": { + "ignore_above": 1024, + "type": "keyword" + }, + "tcp": { + "properties": { + "rtt": { + "properties": { + "connect": { + "properties": { + "us": { + "type": "long" + } + } + }, + "validate": { + "properties": { + "us": { + "type": "long" + } + } + } + } + } + } + }, + "tls": { + "properties": { + "certificate_not_valid_after": { + "type": "date" + }, + "certificate_not_valid_before": { + "type": "date" + }, + "cipher": { + "ignore_above": 1024, + "type": "keyword" + }, + "client": { + "properties": { + "certificate": { + "ignore_above": 1024, + "type": "keyword" + }, + "certificate_chain": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "issuer": { + "type": "wildcard" + }, + "ja3": { + "ignore_above": 1024, + "type": "keyword" + }, + "not_after": { + "type": "date" + }, + "not_before": { + "type": "date" + }, + "server_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject": { + "type": "wildcard" + }, + "supported_ciphers": { + "ignore_above": 1024, + "type": "keyword" + }, + "x509": { + "properties": { + "alternative_names": { + "ignore_above": 1024, + "type": "keyword" + }, + "issuer": { + "properties": { + "common_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country": { + "ignore_above": 1024, + "type": "keyword" + }, + "distinguished_name": { + "type": "wildcard" + }, + "locality": { + "ignore_above": 1024, + "type": "keyword" + }, + "organization": { + "ignore_above": 1024, + "type": "keyword" + }, + "organizational_unit": { + "ignore_above": 1024, + "type": "keyword" + }, + "state_or_province": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "not_after": { + "type": "date" + }, + "not_before": { + "type": "date" + }, + "public_key_algorithm": { + "ignore_above": 1024, + "type": "keyword" + }, + "public_key_curve": { + "ignore_above": 1024, + "type": "keyword" + }, + "public_key_exponent": { + "type": "long" + }, + "public_key_size": { + "type": "long" + }, + "serial_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "signature_algorithm": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject": { + "properties": { + "common_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country": { + "ignore_above": 1024, + "type": "keyword" + }, + "distinguished_name": { + "type": "wildcard" + }, + "locality": { + "ignore_above": 1024, + "type": "keyword" + }, + "organization": { + "ignore_above": 1024, + "type": "keyword" + }, + "organizational_unit": { + "ignore_above": 1024, + "type": "keyword" + }, + "state_or_province": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "version_number": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "curve": { + "ignore_above": 1024, + "type": "keyword" + }, + "established": { + "type": "boolean" + }, + "next_protocol": { + "ignore_above": 1024, + "type": "keyword" + }, + "resumed": { + "type": "boolean" + }, + "rtt": { + "properties": { + "handshake": { + "properties": { + "us": { + "type": "long" + } + } + } + } + }, + "server": { + "properties": { + "certificate": { + "ignore_above": 1024, + "type": "keyword" + }, + "certificate_chain": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "issuer": { + "type": "wildcard" + }, + "ja3s": { + "ignore_above": 1024, + "type": "keyword" + }, + "not_after": { + "type": "date" + }, + "not_before": { + "type": "date" + }, + "subject": { + "type": "wildcard" + }, + "version_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "x509": { + "properties": { + "alternative_names": { + "ignore_above": 1024, + "type": "keyword" + }, + "issuer": { + "properties": { + "common_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country": { + "ignore_above": 1024, + "type": "keyword" + }, + "distinguished_name": { + "type": "wildcard" + }, + "locality": { + "ignore_above": 1024, + "type": "keyword" + }, + "organization": { + "ignore_above": 1024, + "type": "keyword" + }, + "organizational_unit": { + "ignore_above": 1024, + "type": "keyword" + }, + "state_or_province": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "not_after": { + "type": "date" + }, + "not_before": { + "type": "date" + }, + "public_key_algorithm": { + "ignore_above": 1024, + "type": "keyword" + }, + "public_key_curve": { + "ignore_above": 1024, + "type": "keyword" + }, + "public_key_exponent": { + "type": "long" + }, + "public_key_size": { + "type": "long" + }, + "serial_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "signature_algorithm": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject": { + "properties": { + "common_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country": { + "ignore_above": 1024, + "type": "keyword" + }, + "distinguished_name": { + "type": "wildcard" + }, + "locality": { + "ignore_above": 1024, + "type": "keyword" + }, + "organization": { + "ignore_above": 1024, + "type": "keyword" + }, + "organizational_unit": { + "ignore_above": 1024, + "type": "keyword" + }, + "state_or_province": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "version_number": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + }, + "version_protocol": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "url": { + "properties": { + "domain": { + "type": "wildcard" + }, + "extension": { + "ignore_above": 1024, + "type": "keyword" + }, + "fragment": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "type": "wildcard" + }, + "original": { + "type": "wildcard" + }, + "password": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "type": "wildcard" + }, + "port": { + "type": "long" + }, + "query": { + "ignore_above": 1024, + "type": "keyword" + }, + "registered_domain": { + "type": "wildcard" + }, + "scheme": { + "ignore_above": 1024, + "type": "keyword" + }, + "subdomain": { + "ignore_above": 1024, + "type": "keyword" + }, + "top_level_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "username": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "x509": { + "properties": { + "alternative_names": { + "ignore_above": 1024, + "type": "keyword" + }, + "issuer": { + "properties": { + "common_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country": { + "ignore_above": 1024, + "type": "keyword" + }, + "distinguished_name": { + "type": "wildcard" + }, + "locality": { + "ignore_above": 1024, + "type": "keyword" + }, + "organization": { + "ignore_above": 1024, + "type": "keyword" + }, + "organizational_unit": { + "ignore_above": 1024, + "type": "keyword" + }, + "state_or_province": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "not_after": { + "type": "date" + }, + "not_before": { + "type": "date" + }, + "public_key_algorithm": { + "ignore_above": 1024, + "type": "keyword" + }, + "public_key_curve": { + "ignore_above": 1024, + "type": "keyword" + }, + "public_key_exponent": { + "type": "long" + }, + "public_key_size": { + "type": "long" + }, + "serial_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "signature_algorithm": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject": { + "properties": { + "common_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country": { + "ignore_above": 1024, + "type": "keyword" + }, + "distinguished_name": { + "type": "wildcard" + }, + "locality": { + "ignore_above": 1024, + "type": "keyword" + }, + "organization": { + "ignore_above": 1024, + "type": "keyword" + }, + "organizational_unit": { + "ignore_above": 1024, + "type": "keyword" + }, + "state_or_province": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "version_number": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "settings": { + "index": { + "codec": "best_compression", + "hidden": "true", + "lifecycle": { + "name": "synthetics" + }, + "mapping": { + "total_fields": { + "limit": "10000" + } + }, + "number_of_replicas": "1", + "number_of_shards": "1", + "refresh_interval": "5s" + } + } + } +} \ No newline at end of file