[File data visualizer] Adding ecs_compatibility setting for find structure calls (#139708)

* [File data visualizer] Adding ecs_compatibility setting for find structure calls

* fixing tests
This commit is contained in:
James Gowdy 2022-08-31 09:07:07 +01:00 committed by GitHub
parent 68e0a2aab2
commit 2b9faa0d12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 28 deletions

View file

@ -22,6 +22,8 @@ export async function analyzeFile(
const body = await client.asInternalUser.textStructure.findStructure(
{
body: data,
// @ts-expect-error TextStructureFindStructureRequest type is out of date and doesn't include ecs_compatibility
ecs_compatibility: 'v1',
...overrides,
},
{ maxRetries: 0 }

View file

@ -18,7 +18,7 @@ export default function ({ getService }: FtrProviderContext) {
indexName: 'user-import_1',
createIndexPattern: false,
fieldTypeFilters: [ML_JOB_FIELD_TYPES.NUMBER, ML_JOB_FIELD_TYPES.DATE],
fieldNameFilters: ['clientip'],
fieldNameFilters: ['source.address'],
expected: {
results: {
title: 'artificial_server_log',
@ -26,21 +26,21 @@ export default function ({ getService }: FtrProviderContext) {
},
metricFields: [
{
fieldName: 'bytes',
fieldName: 'http.response.body.bytes',
type: ML_JOB_FIELD_TYPES.NUMBER,
docCountFormatted: '19 (100%)',
statsMaxDecimalPlaces: 3,
topValuesCount: 8,
},
{
fieldName: 'httpversion',
fieldName: 'http.version',
type: ML_JOB_FIELD_TYPES.NUMBER,
docCountFormatted: '19 (100%)',
statsMaxDecimalPlaces: 3,
topValuesCount: 1,
},
{
fieldName: 'response',
fieldName: 'http.response.status_code',
type: ML_JOB_FIELD_TYPES.NUMBER,
docCountFormatted: '19 (100%)',
statsMaxDecimalPlaces: 3,
@ -55,43 +55,25 @@ export default function ({ getService }: FtrProviderContext) {
exampleCount: 10,
},
{
fieldName: 'agent',
fieldName: 'user_agent.original',
type: ML_JOB_FIELD_TYPES.KEYWORD,
exampleCount: 8,
docCountFormatted: '19 (100%)',
},
{
fieldName: 'auth',
fieldName: 'http.request.method',
type: ML_JOB_FIELD_TYPES.KEYWORD,
exampleCount: 1,
docCountFormatted: '19 (100%)',
},
{
fieldName: 'ident',
type: ML_JOB_FIELD_TYPES.KEYWORD,
exampleCount: 1,
docCountFormatted: '19 (100%)',
},
{
fieldName: 'verb',
type: ML_JOB_FIELD_TYPES.KEYWORD,
exampleCount: 1,
docCountFormatted: '19 (100%)',
},
{
fieldName: 'request',
fieldName: 'url.original',
type: ML_JOB_FIELD_TYPES.KEYWORD,
exampleCount: 2,
docCountFormatted: '19 (100%)',
},
{
fieldName: 'referrer',
type: ML_JOB_FIELD_TYPES.KEYWORD,
exampleCount: 1,
docCountFormatted: '19 (100%)',
},
{
fieldName: 'clientip',
fieldName: 'source.address',
type: ML_JOB_FIELD_TYPES.IP,
exampleCount: 7,
docCountFormatted: '19 (100%)',
@ -105,8 +87,8 @@ export default function ({ getService }: FtrProviderContext) {
],
visibleMetricFieldsCount: 3,
totalMetricFieldsCount: 3,
populatedFieldsCount: 12,
totalFieldsCount: 12,
populatedFieldsCount: 9,
totalFieldsCount: 9,
fieldTypeFiltersResultCount: 4,
fieldNameFiltersResultCount: 1,
ingestedDocCount: 20,