Rolluphybrid Visualization Test Case using hybrid index pattern (#43821)

This commit is contained in:
Rashmi Kulkarni 2019-08-26 16:39:17 -07:00 committed by GitHub
parent ae4245fea8
commit c3f4cad4d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 1830 additions and 0 deletions

View file

@ -0,0 +1,90 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['common', 'visualize', 'timePicker']);
const inspector = getService('inspector');
describe('hybrid index pattern', () => {
before(async () => {
await esArchiver.load('hybrid/kibana');
await esArchiver.load('hybrid/logstash');
await esArchiver.load('hybrid/rollup');
});
after(async () => {
await esArchiver.unload('hybrid/kibana');
await esArchiver.unload('hybrid/logstash');
await esArchiver.unload('hybrid/rollup');
});
it('should render histogram line chart', async () => {
const expectedData = [
['2019-08-19 00:00', 'gif', '2'],
['2019-08-19 00:00', 'jpg', '2'],
['2019-08-19 00:00', 'css', '1'],
['2019-08-19 08:00', 'jpg', '599'],
['2019-08-19 08:00', 'css', '116'],
['2019-08-19 08:00', 'png', '95'],
['2019-08-19 08:00', 'gif', '68'],
['2019-08-19 08:00', 'php', '38'],
['2019-08-19 16:00', 'jpg', '2,143'],
['2019-08-19 16:00', 'css', '551'],
['2019-08-19 16:00', 'png', '362'],
['2019-08-19 16:00', 'gif', '209'],
['2019-08-19 16:00', 'php', '112'],
['2019-08-20 00:00', 'jpg', '232'],
['2019-08-20 00:00', 'css', '62'],
['2019-08-20 00:00', 'png', '46'],
['2019-08-20 00:00', 'gif', '27'],
['2019-08-20 00:00', 'php', '11'],
['2019-08-20 08:00', 'jpg', '547'],
['2019-08-20 08:00', 'css', '167'],
['2019-08-20 08:00', 'png', '87'],
['2019-08-20 08:00', 'gif', '58'],
['2019-08-20 08:00', 'php', '25'],
['2019-08-20 16:00', 'jpg', '1,719'],
['2019-08-20 16:00', 'css', '458'],
['2019-08-20 16:00', 'png', '246'],
['2019-08-20 16:00', 'gif', '180'],
['2019-08-20 16:00', 'php', '89'],
['2019-08-21 00:00', 'jpg', '252'],
['2019-08-21 00:00', 'css', '72'],
['2019-08-21 00:00', 'png', '40'],
['2019-08-21 00:00', 'gif', '29'],
['2019-08-21 00:00', 'php', '12'],
['2019-08-21 08:00', 'jpg', '624'],
['2019-08-21 08:00', 'css', '145'],
['2019-08-21 08:00', 'png', '91'],
['2019-08-21 08:00', 'gif', '66'],
['2019-08-21 08:00', 'php', '23'],
['2019-08-21 16:00', 'jpg', '2,167'],
['2019-08-21 16:00', 'css', '504'],
['2019-08-21 16:00', 'png', '342'],
['2019-08-21 16:00', 'gif', '219'],
['2019-08-21 16:00', 'php', '103'],
['2019-08-22 00:00', 'jpg', '237'],
['2019-08-22 00:00', 'css', '64'],
['2019-08-22 00:00', 'png', '38'],
['2019-08-22 00:00', 'gif', '29'],
['2019-08-22 00:00', 'php', '11'],
['2019-08-22 16:00', 'jpg', '3'],
];
const fromTime = '2019-08-19 01:55:07.240';
const toTime = '2019-08-22 23:09:36.205';
await PageObjects.common.navigateToApp('visualize');
await PageObjects.visualize.clickVisualizationByName('hybrid_histogram_line_chart');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.visualize.waitForVisualizationRenderingStabilized();
await inspector.open();
await inspector.setTablePageSize('50');
await inspector.expectTableData(expectedData);
});
});
}

View file

@ -12,5 +12,6 @@ export default function visualize({ loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./feature_controls/visualize_security'));
loadTestFile(require.resolve('./feature_controls/visualize_spaces'));
loadTestFile(require.resolve('./hybrid_visualization'));
});
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,404 @@
{
"type": "index",
"value": {
"aliases": {
},
"index": "logstash-0",
"mappings": {
"properties": {
"@message": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"@tags": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"@timestamp": {
"type": "date"
},
"agent": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"bytes": {
"type": "long"
},
"clientip": {
"type": "ip"
},
"extension": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"geo": {
"properties": {
"coordinates": {
"type": "geo_point"
},
"dest": {
"type": "keyword"
},
"src": {
"type": "keyword"
},
"srcdest": {
"type": "keyword"
}
}
},
"headings": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"host": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"id": {
"type": "integer"
},
"index": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"ip": {
"type": "ip"
},
"links": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"longValues": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"longValuesWithSpaces": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"machine": {
"properties": {
"os": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"ram": {
"type": "long"
}
}
},
"memory": {
"type": "double"
},
"meta": {
"properties": {
"char": {
"type": "keyword"
},
"related": {
"type": "text"
},
"user": {
"properties": {
"firstname": {
"type": "text"
},
"lastname": {
"type": "integer"
}
}
}
}
},
"phpmemory": {
"type": "long"
},
"referer": {
"type": "keyword"
},
"relatedContent": {
"properties": {
"article:modified_time": {
"type": "date"
},
"article:published_time": {
"type": "date"
},
"article:section": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"article:tag": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"og:description": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"og:image": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"og:image:height": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"og:image:width": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"og:site_name": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"og:title": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"og:type": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"og:url": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"twitter:card": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"twitter:description": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"twitter:image": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"twitter:site": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"twitter:title": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"url": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"request": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"response": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"spaces": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"thisisaverylongfieldnamethatevendoesnotcontainanyspaceswhyitcouldpotentiallybreakouruiinseveralplaces": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"url": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"utc_time": {
"type": "date"
},
"xss": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"settings": {
"index": {
"analysis": {
"analyzer": {
"makelogs_url": {
"max_token_length": "1000",
"tokenizer": "uax_url_email",
"type": "standard"
}
}
},
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}

View file

@ -0,0 +1,264 @@
{
"type": "index",
"value": {
"aliases": {
},
"index": "rollup_logstash",
"mappings": {
"_meta": {
"_rollup": {
"Rollupjob": {
"cron": "0 * * * * ?",
"groups": {
"date_histogram": {
"delay": "10m",
"field": "@timestamp",
"fixed_interval": "20m",
"time_zone": "UTC"
},
"histogram": {
"fields": [
"machine.ram"
],
"interval": 5
},
"terms": {
"fields": [
"extension.keyword",
"geo.src",
"geo.dest",
"machine.os.keyword"
]
}
},
"id": "Rollupjob",
"index_pattern": "logstash*",
"metrics": [
{
"field": "bytes",
"metrics": [
"avg"
]
},
{
"field": "memory",
"metrics": [
"avg",
"max",
"min",
"sum",
"value_count"
]
}
],
"page_size": 1000,
"rollup_index": "rollup_logstash",
"timeout": "20s"
}
},
"rollup-version": "8.0.0"
},
"dynamic_templates": [
{
"strings": {
"mapping": {
"type": "keyword"
},
"match_mapping_type": "string"
}
},
{
"date_histograms": {
"mapping": {
"type": "date"
},
"path_match": "*.date_histogram.timestamp"
}
}
],
"properties": {
"@timestamp": {
"properties": {
"date_histogram": {
"properties": {
"_count": {
"type": "long"
},
"interval": {
"type": "keyword"
},
"time_zone": {
"type": "keyword"
},
"timestamp": {
"type": "date"
}
}
}
}
},
"_rollup": {
"properties": {
"id": {
"type": "keyword"
},
"version": {
"type": "long"
}
}
},
"bytes": {
"properties": {
"avg": {
"properties": {
"_count": {
"type": "float"
},
"value": {
"type": "float"
}
}
}
}
},
"extension": {
"properties": {
"keyword": {
"properties": {
"terms": {
"properties": {
"_count": {
"type": "long"
},
"value": {
"type": "keyword"
}
}
}
}
}
}
},
"geo": {
"properties": {
"dest": {
"properties": {
"terms": {
"properties": {
"_count": {
"type": "long"
},
"value": {
"type": "keyword"
}
}
}
}
},
"src": {
"properties": {
"terms": {
"properties": {
"_count": {
"type": "long"
},
"value": {
"type": "keyword"
}
}
}
}
}
}
},
"machine": {
"properties": {
"os": {
"properties": {
"keyword": {
"properties": {
"terms": {
"properties": {
"_count": {
"type": "long"
},
"value": {
"type": "keyword"
}
}
}
}
}
}
},
"ram": {
"properties": {
"histogram": {
"properties": {
"_count": {
"type": "long"
},
"interval": {
"type": "long"
},
"value": {
"type": "float"
}
}
}
}
}
}
},
"memory": {
"properties": {
"avg": {
"properties": {
"_count": {
"type": "float"
},
"value": {
"type": "float"
}
}
},
"max": {
"properties": {
"value": {
"type": "float"
}
}
},
"min": {
"properties": {
"value": {
"type": "float"
}
}
},
"sum": {
"properties": {
"value": {
"type": "float"
}
}
},
"value_count": {
"properties": {
"value": {
"type": "float"
}
}
}
}
}
}
},
"settings": {
"index": {
"number_of_replicas": "1",
"number_of_shards": "1"
}
}
}
}