From 343d11b89354e40b7525c86b0a53a1a3f0c56462 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 17 Dec 2024 16:12:49 -0800 Subject: [PATCH 1/6] Add find field structure and find messages structure APIs --- output/openapi/elasticsearch-openapi.json | 448 ++++++++++++++- output/schema/schema.json | 510 +++++++++++++++++- output/schema/validation-errors.json | 12 - output/typescript/types.ts | 48 ++ .../find_structure/FindStructureRequest.ts | 4 +- 5 files changed, 998 insertions(+), 24 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 5dd6684516..5ef284cf8a 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -33851,6 +33851,276 @@ } } }, + "/_text_structure/find_field_structure": { + "get": { + "tags": [ + "text_structure" + ], + "summary": "Find the structure of a text field", + "description": "Find the structure of a text field in an Elasticsearch index.", + "operationId": "text-structure-find-field-structure", + "parameters": [ + { + "in": "query", + "name": "column_names", + "description": "If `format` is set to `delimited`, you can specify the column names in a comma-separated list.\nIf this parameter is not specified, the structure finder uses the column names from the header row of the text.\nIf the text does not have a header row, columns are named \"column1\", \"column2\", \"column3\", for example.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "delimiter", + "description": "If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "documents_to_sample", + "description": "The number of documents to include in the structural analysis.\nThe minimum value is 2.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:uint" + }, + "style": "form" + }, + { + "in": "query", + "name": "ecs_compatibility", + "description": "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of the meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output.\nThe intention in that situation is that a user who knows the meanings will rename the fields before using them.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/text_structure.find_field_structure:EcsCompatibilityType" + }, + "style": "form" + }, + { + "in": "query", + "name": "explain", + "description": "If true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "field", + "description": "The field that should be analyzed.", + "required": true, + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "format", + "description": "The high level structure of the text.\nBy default, the API chooses the format.\nIn this default scenario, all rows must have the same number of fields for a delimited format to be detected.\nIf the format is set to delimited and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/text_structure.find_field_structure:FormatType" + }, + "style": "form" + }, + { + "in": "query", + "name": "grok_pattern", + "description": "If the format is `semi_structured_text`, you can specify a Grok pattern that is used to extract fields from every message in the text.\nThe name of the timestamp field in the Grok pattern must match what is specified in the `timestamp_field` parameter.\nIf that parameter is not specified, the name of the timestamp field in the Grok pattern must match \"timestamp\".\nIf `grok_pattern` is not specified, the structure finder creates a Grok pattern.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:GrokPattern" + }, + "style": "form" + }, + { + "in": "query", + "name": "index", + "description": "The name of the index that contains the analyzed field.", + "required": true, + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "quote", + "description": "If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`\"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "should_trim_fields", + "description": "If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is false.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "timeout", + "description": "The maximum amount of time that the structure analysis can take.\nIf the analysis is still running when the timeout expires, it will be stopped.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Duration" + }, + "style": "form" + }, + { + "in": "query", + "name": "timestamp_field", + "description": "The name of the field that contains the primary timestamp of each record in the text.\nIn particular, if the text was ingested into an index, this is the field that would be used to populate the `@timestamp` field.\n\nIf the format is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`.\nTherefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified.\n\nFor structured text, if you specify this parameter, the field must exist within the text.\n\nIf this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field.\nFor structured text, it is not compulsory to have a timestamp in the text.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "timestamp_format", + "description": "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/_text_structure/find_message_structure": { + "get": { + "tags": [ + "text_structure" + ], + "summary": "Find the structure of text messages", + "description": "Find the structure of a list of text messages.\nThe messages must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUse this API rather than the find text structure API if your input text has already been split up into separate messages by some other process.\nThe response from the API contains:\n\n* Sample messages.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\nAppropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.", + "operationId": "text-structure-find-message-structure", + "parameters": [ + { + "$ref": "#/components/parameters/text_structure.find_message_structure#column_names" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#delimiter" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#ecs_compatibility" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#explain" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#format" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#grok_pattern" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#quote" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#should_trim_fields" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#timeout" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#timestamp_field" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#timestamp_format" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/text_structure.find_message_structure" + }, + "responses": { + "200": { + "$ref": "#/components/responses/text_structure.find_message_structure#200" + } + } + }, + "post": { + "tags": [ + "text_structure" + ], + "summary": "Find the structure of text messages", + "description": "Find the structure of a list of text messages.\nThe messages must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUse this API rather than the find text structure API if your input text has already been split up into separate messages by some other process.\nThe response from the API contains:\n\n* Sample messages.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\nAppropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.", + "operationId": "text-structure-find-message-structure-1", + "parameters": [ + { + "$ref": "#/components/parameters/text_structure.find_message_structure#column_names" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#delimiter" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#ecs_compatibility" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#explain" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#format" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#grok_pattern" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#quote" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#should_trim_fields" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#timeout" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#timestamp_field" + }, + { + "$ref": "#/components/parameters/text_structure.find_message_structure#timestamp_format" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/text_structure.find_message_structure" + }, + "responses": { + "200": { + "$ref": "#/components/responses/text_structure.find_message_structure#200" + } + } + } + }, "/_text_structure/find_structure": { "post": { "tags": [ @@ -33873,7 +34143,7 @@ { "in": "query", "name": "column_names", - "description": "If you have set format to delimited, you can specify the column names in a comma-separated list. If this parameter is not specified, the structure finder uses the column names from the header row of the text. If the text does not have a header role, columns are named \"column1\", \"column2\", \"column3\", etc.", + "description": "If you have set format to delimited, you can specify the column names in a comma-separated list. If this parameter is not specified, the structure finder uses the column names from the header row of the text. If the text does not have a header role, columns are named \"column1\", \"column2\", \"column3\", for example.", "deprecated": false, "schema": { "type": "string" @@ -33983,7 +34253,7 @@ { "in": "query", "name": "timeout", - "description": "Sets the maximum amount of time that the structure analysis make take. If the analysis is still running when the timeout expires then it will be aborted.", + "description": "Sets the maximum amount of time that the structure analysis can take. If the analysis is still running when the timeout expires then it will be stopped.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types:Duration" @@ -85637,6 +85907,38 @@ "none" ] }, + "text_structure.find_field_structure:EcsCompatibilityType": { + "type": "string", + "enum": [ + "disabled", + "v1" + ] + }, + "text_structure.find_field_structure:FormatType": { + "type": "string", + "enum": [ + "delimited", + "ndjson", + "semi_structured_text", + "xml" + ] + }, + "text_structure.find_message_structure:EcsCompatibilityType": { + "type": "string", + "enum": [ + "disabled", + "v1" + ] + }, + "text_structure.find_message_structure:FormatType": { + "type": "string", + "enum": [ + "delimited", + "ndjson", + "semi_structured_text", + "xml" + ] + }, "text_structure.find_structure:FieldStat": { "type": "object", "properties": { @@ -93079,6 +93381,16 @@ } } }, + "text_structure.find_message_structure#200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, "text_structure.test_grok_pattern#200": { "description": "", "content": { @@ -102289,6 +102601,116 @@ }, "style": "form" }, + "text_structure.find_message_structure#column_names": { + "in": "query", + "name": "column_names", + "description": "If the format is `delimited`, you can specify the column names in a comma-separated list.\nIf this parameter is not specified, the structure finder uses the column names from the header row of the text.\nIf the text does not have a header role, columns are named \"column1\", \"column2\", \"column3\", for example.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + "text_structure.find_message_structure#delimiter": { + "in": "query", + "name": "delimiter", + "description": "If you the format is `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + "text_structure.find_message_structure#ecs_compatibility": { + "in": "query", + "name": "ecs_compatibility", + "description": "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/text_structure.find_message_structure:EcsCompatibilityType" + }, + "style": "form" + }, + "text_structure.find_message_structure#explain": { + "in": "query", + "name": "explain", + "description": "If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + "text_structure.find_message_structure#format": { + "in": "query", + "name": "format", + "description": "The high level structure of the text.\nBy default, the API chooses the format.\nIn this default scenario, all rows must have the same number of fields for a delimited format to be detected.\nIf the format is `delimited` and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/text_structure.find_message_structure:FormatType" + }, + "style": "form" + }, + "text_structure.find_message_structure#grok_pattern": { + "in": "query", + "name": "grok_pattern", + "description": "If the format is `semi_structured_text`, you can specify a Grok pattern that is used to extract fields from every message in the text.\nThe name of the timestamp field in the Grok pattern must match what is specified in the `timestamp_field` parameter.\nIf that parameter is not specified, the name of the timestamp field in the Grok pattern must match \"timestamp\".\nIf `grok_pattern` is not specified, the structure finder creates a Grok pattern.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:GrokPattern" + }, + "style": "form" + }, + "text_structure.find_message_structure#quote": { + "in": "query", + "name": "quote", + "description": "If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`\"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + "text_structure.find_message_structure#should_trim_fields": { + "in": "query", + "name": "should_trim_fields", + "description": "If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is false.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + "text_structure.find_message_structure#timeout": { + "in": "query", + "name": "timeout", + "description": "The maximum amount of time that the structure analysis can take.\nIf the analysis is still running when the timeout expires, it will be stopped.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Duration" + }, + "style": "form" + }, + "text_structure.find_message_structure#timestamp_field": { + "in": "query", + "name": "timestamp_field", + "description": "The name of the field that contains the primary timestamp of each record in the text.\nIn particular, if the text was ingested into an index, this is the field that would be used to populate the `@timestamp` field.\n\nIf the format is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`.\nTherefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified.\n\nFor structured text, if you specify this parameter, the field must exist within the text.\n\nIf this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field.\nFor structured text, it is not compulsory to have a timestamp in the text.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Field" + }, + "style": "form" + }, + "text_structure.find_message_structure#timestamp_format": { + "in": "query", + "name": "timestamp_format", + "description": "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, "text_structure.test_grok_pattern#ecs_compatibility": { "in": "query", "name": "ecs_compatibility", @@ -105233,6 +105655,28 @@ } } }, + "text_structure.find_message_structure": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "description": "The list of messages you want to analyze.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "messages" + ] + } + } + }, + "required": true + }, "text_structure.test_grok_pattern": { "content": { "application/json": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 43f3e2115d..b39b4ef9b8 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -19545,12 +19545,23 @@ "visibility": "public" } }, - "description": "Finds the structure of a text field in an index.", + "description": "Find the structure of a text field.\nFind the structure of a text field in an Elasticsearch index.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/find-field-structure.html", "name": "text_structure.find_field_structure", - "request": null, + "privileges": { + "cluster": [ + "monitor_text_structure" + ] + }, + "request": { + "name": "Request", + "namespace": "text_structure.find_field_structure" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "text_structure.find_field_structure" + }, "responseMediaType": [ "application/json" ], @@ -19570,15 +19581,26 @@ "visibility": "public" } }, - "description": "Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch.", + "description": "Find the structure of text messages.\nFind the structure of a list of text messages.\nThe messages must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUse this API rather than the find text structure API if your input text has already been split up into separate messages by some other process.\nThe response from the API contains:\n\n* Sample messages.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\nAppropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/find-message-structure.html", "name": "text_structure.find_message_structure", - "request": null, + "privileges": { + "cluster": [ + "monitor_text_structure" + ] + }, + "request": { + "name": "Request", + "namespace": "text_structure.find_message_structure" + }, "requestBodyRequired": true, "requestMediaType": [ "application/json" ], - "response": null, + "response": { + "name": "Response", + "namespace": "text_structure.find_message_structure" + }, "responseMediaType": [ "application/json" ], @@ -208273,6 +208295,478 @@ }, "specLocation": "tasks/list/ListTasksResponse.ts#L22-L24" }, + { + "kind": "enum", + "members": [ + { + "name": "disabled" + }, + { + "name": "v1" + } + ], + "name": { + "name": "EcsCompatibilityType", + "namespace": "text_structure.find_field_structure" + }, + "specLocation": "text_structure/find_field_structure/FindFieldStructureRequest.ts#L161-L164" + }, + { + "kind": "enum", + "members": [ + { + "name": "delimited" + }, + { + "name": "ndjson" + }, + { + "name": "semi_structured_text" + }, + { + "name": "xml" + } + ], + "name": { + "name": "FormatType", + "namespace": "text_structure.find_field_structure" + }, + "specLocation": "text_structure/find_field_structure/FindFieldStructureRequest.ts#L166-L171" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Find the structure of a text field.\nFind the structure of a text field in an Elasticsearch index.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "text_structure.find_field_structure" + }, + "path": [], + "query": [ + { + "description": "If `format` is set to `delimited`, you can specify the column names in a comma-separated list.\nIf this parameter is not specified, the structure finder uses the column names from the header row of the text.\nIf the text does not have a header row, columns are named \"column1\", \"column2\", \"column3\", for example.", + "name": "column_names", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.", + "name": "delimiter", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The number of documents to include in the structural analysis.\nThe minimum value is 2.", + "name": "documents_to_sample", + "required": false, + "serverDefault": 1000, + "type": { + "kind": "instance_of", + "type": { + "name": "uint", + "namespace": "_types" + } + } + }, + { + "description": "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of the meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output.\nThe intention in that situation is that a user who knows the meanings will rename the fields before using them.", + "name": "ecs_compatibility", + "required": false, + "serverDefault": "disabled", + "type": { + "kind": "instance_of", + "type": { + "name": "EcsCompatibilityType", + "namespace": "text_structure.find_field_structure" + } + } + }, + { + "description": "If true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.", + "name": "explain", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The field that should be analyzed.", + "name": "field", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The high level structure of the text.\nBy default, the API chooses the format.\nIn this default scenario, all rows must have the same number of fields for a delimited format to be detected.\nIf the format is set to delimited and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row.", + "name": "format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "FormatType", + "namespace": "text_structure.find_field_structure" + } + } + }, + { + "description": "If the format is `semi_structured_text`, you can specify a Grok pattern that is used to extract fields from every message in the text.\nThe name of the timestamp field in the Grok pattern must match what is specified in the `timestamp_field` parameter.\nIf that parameter is not specified, the name of the timestamp field in the Grok pattern must match \"timestamp\".\nIf `grok_pattern` is not specified, the structure finder creates a Grok pattern.", + "name": "grok_pattern", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GrokPattern", + "namespace": "_types" + } + } + }, + { + "description": "The name of the index that contains the analyzed field.", + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`\"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.", + "name": "quote", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is false.", + "name": "should_trim_fields", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The maximum amount of time that the structure analysis can take.\nIf the analysis is still running when the timeout expires, it will be stopped.", + "name": "timeout", + "required": false, + "serverDefault": "25s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The name of the field that contains the primary timestamp of each record in the text.\nIn particular, if the text was ingested into an index, this is the field that would be used to populate the `@timestamp` field.\n\nIf the format is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`.\nTherefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified.\n\nFor structured text, if you specify this parameter, the field must exist within the text.\n\nIf this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field.\nFor structured text, it is not compulsory to have a timestamp in the text.", + "name": "timestamp_field", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.", + "name": "timestamp_format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "text_structure/find_field_structure/FindFieldStructureRequest.ts#L24-L159" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [] + }, + "name": { + "name": "Response", + "namespace": "text_structure.find_field_structure" + }, + "specLocation": "text_structure/find_field_structure/FindFieldStructureResponse.ts#L19-L21" + }, + { + "kind": "enum", + "members": [ + { + "name": "disabled" + }, + { + "name": "v1" + } + ], + "name": { + "name": "EcsCompatibilityType", + "namespace": "text_structure.find_message_structure" + }, + "specLocation": "text_structure/find_message_structure/FindMessageStructureRequest.ts#L162-L165" + }, + { + "kind": "enum", + "members": [ + { + "name": "delimited" + }, + { + "name": "ndjson" + }, + { + "name": "semi_structured_text" + }, + { + "name": "xml" + } + ], + "name": { + "name": "FormatType", + "namespace": "text_structure.find_message_structure" + }, + "specLocation": "text_structure/find_message_structure/FindMessageStructureRequest.ts#L167-L172" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "description": "The list of messages you want to analyze.", + "name": "messages", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + } + ] + }, + "description": "Find the structure of text messages.\nFind the structure of a list of text messages.\nThe messages must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUse this API rather than the find text structure API if your input text has already been split up into separate messages by some other process.\nThe response from the API contains:\n\n* Sample messages.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\nAppropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "text_structure.find_message_structure" + }, + "path": [], + "query": [ + { + "description": "If the format is `delimited`, you can specify the column names in a comma-separated list.\nIf this parameter is not specified, the structure finder uses the column names from the header row of the text.\nIf the text does not have a header role, columns are named \"column1\", \"column2\", \"column3\", for example.", + "name": "column_names", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "If you the format is `delimited`, you can specify the character used to delimit the values in each row.\nOnly a single character is supported; the delimiter cannot have multiple characters.\nBy default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`).\nIn this default scenario, all rows must have the same number of fields for the delimited format to be detected.\nIf you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.", + "name": "delimiter", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it.", + "name": "ecs_compatibility", + "required": false, + "serverDefault": "disabled", + "type": { + "kind": "instance_of", + "type": { + "name": "EcsCompatibilityType", + "namespace": "text_structure.find_message_structure" + } + } + }, + { + "description": "If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result.", + "name": "explain", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The high level structure of the text.\nBy default, the API chooses the format.\nIn this default scenario, all rows must have the same number of fields for a delimited format to be detected.\nIf the format is `delimited` and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row.", + "name": "format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "FormatType", + "namespace": "text_structure.find_message_structure" + } + } + }, + { + "description": "If the format is `semi_structured_text`, you can specify a Grok pattern that is used to extract fields from every message in the text.\nThe name of the timestamp field in the Grok pattern must match what is specified in the `timestamp_field` parameter.\nIf that parameter is not specified, the name of the timestamp field in the Grok pattern must match \"timestamp\".\nIf `grok_pattern` is not specified, the structure finder creates a Grok pattern.", + "name": "grok_pattern", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GrokPattern", + "namespace": "_types" + } + } + }, + { + "description": "If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character.\nOnly a single character is supported.\nIf this parameter is not specified, the default value is a double quote (`\"`).\nIf your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.", + "name": "quote", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them.\nIf this parameter is not specified and the delimiter is pipe (`|`), the default value is true.\nOtherwise, the default value is false.", + "name": "should_trim_fields", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The maximum amount of time that the structure analysis can take.\nIf the analysis is still running when the timeout expires, it will be stopped.", + "name": "timeout", + "required": false, + "serverDefault": "25s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The name of the field that contains the primary timestamp of each record in the text.\nIn particular, if the text was ingested into an index, this is the field that would be used to populate the `@timestamp` field.\n\nIf the format is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`.\nTherefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified.\n\nFor structured text, if you specify this parameter, the field must exist within the text.\n\nIf this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field.\nFor structured text, it is not compulsory to have a timestamp in the text.", + "name": "timestamp_field", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + } + }, + { + "description": "The Java time format of the timestamp field in the text.\nOnly a subset of Java time format letter groups are supported:\n\n* `a`\n* `d`\n* `dd`\n* `EEE`\n* `EEEE`\n* `H`\n* `HH`\n* `h`\n* `M`\n* `MM`\n* `MMM`\n* `MMMM`\n* `mm`\n* `ss`\n* `XX`\n* `XXX`\n* `yy`\n* `yyyy`\n* `zzz`\n\nAdditionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`).\nSpacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes.\nFor example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format.\n\nOne valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`.\nAnother is when the timestamp format is one that the structure finder does not consider by default.\n\nIf this parameter is not specified, the structure finder chooses the best format from a built-in set.\n\nIf the special value `null` is specified, the structure finder will not look for a primary timestamp in the text.\nWhen the format is semi-structured text, this will result in the structure finder treating the text as single-line messages.", + "name": "timestamp_format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "text_structure/find_message_structure/FindMessageStructureRequest.ts#L23-L160" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [] + }, + "name": { + "name": "Response", + "namespace": "text_structure.find_message_structure" + }, + "specLocation": "text_structure/find_message_structure/FindMessageStructureResponse.ts#L19-L21" + }, { "kind": "interface", "name": { @@ -208427,7 +208921,7 @@ } }, { - "description": "If you have set format to delimited, you can specify the column names in a comma-separated list. If this parameter is not specified, the structure finder uses the column names from the header row of the text. If the text does not have a header role, columns are named \"column1\", \"column2\", \"column3\", etc.", + "description": "If you have set format to delimited, you can specify the column names in a comma-separated list. If this parameter is not specified, the structure finder uses the column names from the header row of the text. If the text does not have a header role, columns are named \"column1\", \"column2\", \"column3\", for example.", "name": "column_names", "required": false, "type": { @@ -208562,7 +209056,7 @@ } }, { - "description": "Sets the maximum amount of time that the structure analysis make take. If the analysis is still running when the timeout expires then it will be aborted.", + "description": "Sets the maximum amount of time that the structure analysis can take. If the analysis is still running when the timeout expires then it will be stopped.", "name": "timeout", "required": false, "serverDefault": "25s", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 18f4b43d11..4f684a94c8 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -859,18 +859,6 @@ ], "response": [] }, - "text_structure.find_field_structure": { - "request": [ - "Missing request & response" - ], - "response": [] - }, - "text_structure.find_message_structure": { - "request": [ - "Missing request & response" - ], - "response": [] - }, "transform.get_node_stats": { "request": [ "Missing request & response" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 2de101888b..d1a07f8de7 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -19713,6 +19713,54 @@ export interface TasksListRequest extends RequestBase { export type TasksListResponse = TasksTaskListResponseBase +export type TextStructureFindFieldStructureEcsCompatibilityType = 'disabled' | 'v1' + +export type TextStructureFindFieldStructureFormatType = 'delimited' | 'ndjson' | 'semi_structured_text' | 'xml' + +export interface TextStructureFindFieldStructureRequest extends RequestBase { + column_names?: string + delimiter?: string + documents_to_sample?: uint + ecs_compatibility?: TextStructureFindFieldStructureEcsCompatibilityType + explain?: boolean + field: string + format?: TextStructureFindFieldStructureFormatType + grok_pattern?: GrokPattern + index: string + quote?: string + should_trim_fields?: boolean + timeout?: Duration + timestamp_field?: string + timestamp_format?: string +} + +export interface TextStructureFindFieldStructureResponse { +} + +export type TextStructureFindMessageStructureEcsCompatibilityType = 'disabled' | 'v1' + +export type TextStructureFindMessageStructureFormatType = 'delimited' | 'ndjson' | 'semi_structured_text' | 'xml' + +export interface TextStructureFindMessageStructureRequest extends RequestBase { + column_names?: string + delimiter?: string + ecs_compatibility?: TextStructureFindMessageStructureEcsCompatibilityType + explain?: boolean + format?: TextStructureFindMessageStructureFormatType + grok_pattern?: GrokPattern + quote?: string + should_trim_fields?: boolean + timeout?: Duration + timestamp_field?: Field + timestamp_format?: string + body?: { + messages: string[] + } +} + +export interface TextStructureFindMessageStructureResponse { +} + export interface TextStructureFindStructureFieldStat { count: integer cardinality: integer diff --git a/specification/text_structure/find_structure/FindStructureRequest.ts b/specification/text_structure/find_structure/FindStructureRequest.ts index ae48be2faf..94544f0ce8 100644 --- a/specification/text_structure/find_structure/FindStructureRequest.ts +++ b/specification/text_structure/find_structure/FindStructureRequest.ts @@ -30,7 +30,7 @@ export interface Request { query_parameters: { /** The text’s character set. It must be a character set that is supported by the JVM that Elasticsearch uses. For example, UTF-8, UTF-16LE, windows-1252, or EUC-JP. If this parameter is not specified, the structure finder chooses an appropriate character set. */ charset?: string - /** If you have set format to delimited, you can specify the column names in a comma-separated list. If this parameter is not specified, the structure finder uses the column names from the header row of the text. If the text does not have a header role, columns are named "column1", "column2", "column3", etc. */ + /** If you have set format to delimited, you can specify the column names in a comma-separated list. If this parameter is not specified, the structure finder uses the column names from the header row of the text. If the text does not have a header role, columns are named "column1", "column2", "column3", for example. */ column_names?: string /** If you have set format to delimited, you can specify the character used to delimit the values in each row. Only a single character is supported; the delimiter cannot have multiple characters. By default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (|). In this default scenario, all rows must have the same number of fields for the delimited format to be detected. If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. */ delimiter?: string @@ -62,7 +62,7 @@ export interface Request { /** If you have set format to delimited, you can specify whether values between delimiters should have whitespace trimmed from them. If this parameter is not specified and the delimiter is pipe (|), the default value is true. Otherwise, the default value is false. */ should_trim_fields?: boolean /** - * Sets the maximum amount of time that the structure analysis make take. If the analysis is still running when the timeout expires then it will be aborted. + * Sets the maximum amount of time that the structure analysis can take. If the analysis is still running when the timeout expires then it will be stopped. * @server_default 25s */ timeout?: Duration From f75a24a775aab7e0b66428915e775d7137a38aa8 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 17 Dec 2024 16:15:19 -0800 Subject: [PATCH 2/6] Add new requests and responses --- .../FindFieldStructureRequest.ts | 171 +++++++++++++++++ .../FindFieldStructureResponse.ts | 21 +++ .../FindMessageStructureRequest.ts | 172 ++++++++++++++++++ .../FindMessageStructureResponse.ts | 21 +++ 4 files changed, 385 insertions(+) create mode 100644 specification/text_structure/find_field_structure/FindFieldStructureRequest.ts create mode 100644 specification/text_structure/find_field_structure/FindFieldStructureResponse.ts create mode 100644 specification/text_structure/find_message_structure/FindMessageStructureRequest.ts create mode 100644 specification/text_structure/find_message_structure/FindMessageStructureResponse.ts diff --git a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts new file mode 100644 index 0000000000..7d9fc75cfc --- /dev/null +++ b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts @@ -0,0 +1,171 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { RequestBase } from '@_types/Base' +import { GrokPattern } from '@_types/common' +import { uint } from '@_types/Numeric' +import { Duration } from '@_types/Time' +/** + * Find the structure of a text field. + * Find the structure of a text field in an Elasticsearch index. + * @rest_spec_name text_structure.find_field_structure + * @availability stack stability=stable visibility=public + * @cluster_privileges monitor_text_structure + */ +interface Request extends RequestBase { + query_parameters: { + /** + * If `format` is set to `delimited`, you can specify the column names in a comma-separated list. + * If this parameter is not specified, the structure finder uses the column names from the header row of the text. + * If the text does not have a header row, columns are named "column1", "column2", "column3", for example. + */ + column_names?: string + /** + * If you have set `format` to `delimited`, you can specify the character used to delimit the values in each row. + * Only a single character is supported; the delimiter cannot have multiple characters. + * By default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`). + * In this default scenario, all rows must have the same number of fields for the delimited format to be detected. + * If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. + */ + delimiter?: string + /** + * The number of documents to include in the structural analysis. + * The minimum value is 2. + * @server_default 1000 + */ + documents_to_sample?: uint + /** + * The mode of compatibility with ECS compliant Grok patterns. + * Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern. + * This setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input. + * If the structure finder identifies a common structure but has no idea of the meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output. + * The intention in that situation is that a user who knows the meanings will rename the fields before using them. + * @server_default disabled + */ + ecs_compatibility?: EcsCompatibilityType + /** + * If true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result. + * @server_default false + */ + explain?: boolean + /** + * The field that should be analyzed. + */ + field: string + /** + * The high level structure of the text. + * By default, the API chooses the format. + * In this default scenario, all rows must have the same number of fields for a delimited format to be detected. + * If the format is set to delimited and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row. + */ + format?: FormatType + /** + * If the format is `semi_structured_text`, you can specify a Grok pattern that is used to extract fields from every message in the text. + * The name of the timestamp field in the Grok pattern must match what is specified in the `timestamp_field` parameter. + * If that parameter is not specified, the name of the timestamp field in the Grok pattern must match "timestamp". + * If `grok_pattern` is not specified, the structure finder creates a Grok pattern. + */ + grok_pattern?: GrokPattern + /** + * The name of the index that contains the analyzed field. + */ + index: string + /** + * If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character. + * Only a single character is supported. + * If this parameter is not specified, the default value is a double quote (`"`). + * If your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample. + */ + quote?: string + /** + * If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them. + * If this parameter is not specified and the delimiter is pipe (`|`), the default value is true. + * Otherwise, the default value is false. + */ + should_trim_fields?: boolean + /** + * The maximum amount of time that the structure analysis can take. + * If the analysis is still running when the timeout expires, it will be stopped. + * @server_default 25s + */ + timeout?: Duration + /** + * The name of the field that contains the primary timestamp of each record in the text. + * In particular, if the text was ingested into an index, this is the field that would be used to populate the `@timestamp` field. + * + * If the format is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`. + * Therefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified. + * + * For structured text, if you specify this parameter, the field must exist within the text. + * + * If this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field. + * For structured text, it is not compulsory to have a timestamp in the text. + */ + timestamp_field?: string + /** + * The Java time format of the timestamp field in the text. + * Only a subset of Java time format letter groups are supported: + * + * * `a` + * * `d` + * * `dd` + * * `EEE` + * * `EEEE` + * * `H` + * * `HH` + * * `h` + * * `M` + * * `MM` + * * `MMM` + * * `MMMM` + * * `mm` + * * `ss` + * * `XX` + * * `XXX` + * * `yy` + * * `yyyy` + * * `zzz` + * + * Additionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`). + * Spacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes. + * For example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format. + * + * One valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`. + * Another is when the timestamp format is one that the structure finder does not consider by default. + * + * If this parameter is not specified, the structure finder chooses the best format from a built-in set. + * + * If the special value `null` is specified, the structure finder will not look for a primary timestamp in the text. + * When the format is semi-structured text, this will result in the structure finder treating the text as single-line messages. + */ + timestamp_format?: string + } +} + +export enum EcsCompatibilityType { + disabled, + v1 +} + +export enum FormatType { + delimited, + ndjson, + semi_structured_text, + xml +} diff --git a/specification/text_structure/find_field_structure/FindFieldStructureResponse.ts b/specification/text_structure/find_field_structure/FindFieldStructureResponse.ts new file mode 100644 index 0000000000..598b913c3e --- /dev/null +++ b/specification/text_structure/find_field_structure/FindFieldStructureResponse.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export class Response { + body: {} +} diff --git a/specification/text_structure/find_message_structure/FindMessageStructureRequest.ts b/specification/text_structure/find_message_structure/FindMessageStructureRequest.ts new file mode 100644 index 0000000000..420377b3fc --- /dev/null +++ b/specification/text_structure/find_message_structure/FindMessageStructureRequest.ts @@ -0,0 +1,172 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { RequestBase } from '@_types/Base' +import { Field, GrokPattern } from '@_types/common' +import { Duration } from '@_types/Time' +/** + * Find the structure of text messages. + * Find the structure of a list of text messages. + * The messages must contain data that is suitable to be ingested into Elasticsearch. + * + * This API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality. + * Use this API rather than the find text structure API if your input text has already been split up into separate messages by some other process. + * The response from the API contains: + * + * * Sample messages. + * * Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields. + * * Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text. + * Appropriate mappings for an Elasticsearch index, which you could use to ingest the text. + * + * All this information can be calculated by the structure finder with no guidance. + * However, you can optionally override some of the decisions about the text structure by specifying one or more query parameters. + * @rest_spec_name text_structure.find_message_structure + * @availability stack stability=stable visibility=public + * @cluster_privileges monitor_text_structure + */ +interface Request extends RequestBase { + query_parameters: { + /** If the format is `delimited`, you can specify the column names in a comma-separated list. + * If this parameter is not specified, the structure finder uses the column names from the header row of the text. + * If the text does not have a header role, columns are named "column1", "column2", "column3", for example. + */ + column_names?: string + /** + * If you the format is `delimited`, you can specify the character used to delimit the values in each row. + * Only a single character is supported; the delimiter cannot have multiple characters. + * By default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (`|`). + * In this default scenario, all rows must have the same number of fields for the delimited format to be detected. + * If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. + */ + delimiter?: string + /** + * The mode of compatibility with ECS compliant Grok patterns. + * Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern. + * This setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input. + * If the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it. + * @server_default disabled + */ + ecs_compatibility?: EcsCompatibilityType + /** + * If this parameter is set to true, the response includes a field named `explanation`, which is an array of strings that indicate how the structure finder produced its result. + * @server_default false + */ + explain?: boolean + /** The high level structure of the text. + * By default, the API chooses the format. + * In this default scenario, all rows must have the same number of fields for a delimited format to be detected. + * If the format is `delimited` and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row. + */ + format?: FormatType + /** + * If the format is `semi_structured_text`, you can specify a Grok pattern that is used to extract fields from every message in the text. + * The name of the timestamp field in the Grok pattern must match what is specified in the `timestamp_field` parameter. + * If that parameter is not specified, the name of the timestamp field in the Grok pattern must match "timestamp". + * If `grok_pattern` is not specified, the structure finder creates a Grok pattern. + */ + grok_pattern?: GrokPattern + /** + * If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character. + * Only a single character is supported. + * If this parameter is not specified, the default value is a double quote (`"`). + * If your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample. + */ + quote?: string + /** + * If the format is `delimited`, you can specify whether values between delimiters should have whitespace trimmed from them. + * If this parameter is not specified and the delimiter is pipe (`|`), the default value is true. + * Otherwise, the default value is false. + */ + should_trim_fields?: boolean + /** + * The maximum amount of time that the structure analysis can take. + * If the analysis is still running when the timeout expires, it will be stopped. + * @server_default 25s + */ + timeout?: Duration + /** + * The name of the field that contains the primary timestamp of each record in the text. + * In particular, if the text was ingested into an index, this is the field that would be used to populate the `@timestamp` field. + * + * If the format is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`. + * Therefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified. + * + * For structured text, if you specify this parameter, the field must exist within the text. + * + * If this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field. + * For structured text, it is not compulsory to have a timestamp in the text. + */ + timestamp_field?: Field + /** + * The Java time format of the timestamp field in the text. + * Only a subset of Java time format letter groups are supported: + * + * * `a` + * * `d` + * * `dd` + * * `EEE` + * * `EEEE` + * * `H` + * * `HH` + * * `h` + * * `M` + * * `MM` + * * `MMM` + * * `MMMM` + * * `mm` + * * `ss` + * * `XX` + * * `XXX` + * * `yy` + * * `yyyy` + * * `zzz` + * + * Additionally `S` letter groups (fractional seconds) of length one to nine are supported providing they occur after `ss` and are separated from the `ss` by a period (`.`), comma (`,`), or colon (`:`). + * Spacing and punctuation is also permitted with the exception a question mark (`?`), newline, and carriage return, together with literal text enclosed in single quotes. + * For example, `MM/dd HH.mm.ss,SSSSSS 'in' yyyy` is a valid override format. + * + * One valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full `grok_pattern`. + * Another is when the timestamp format is one that the structure finder does not consider by default. + * + * If this parameter is not specified, the structure finder chooses the best format from a built-in set. + * + * If the special value `null` is specified, the structure finder will not look for a primary timestamp in the text. + * When the format is semi-structured text, this will result in the structure finder treating the text as single-line messages. + */ + timestamp_format?: string + } + body: { + /** + * The list of messages you want to analyze. + */ + messages: Array + } +} + +export enum EcsCompatibilityType { + disabled, + v1 +} + +export enum FormatType { + delimited, + ndjson, + semi_structured_text, + xml +} diff --git a/specification/text_structure/find_message_structure/FindMessageStructureResponse.ts b/specification/text_structure/find_message_structure/FindMessageStructureResponse.ts new file mode 100644 index 0000000000..598b913c3e --- /dev/null +++ b/specification/text_structure/find_message_structure/FindMessageStructureResponse.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export class Response { + body: {} +} From 898e54ed5f17f77eadf4e2a178f0ab6b7bc22ea6 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 18 Dec 2024 18:19:17 -0800 Subject: [PATCH 3/6] Update specification/text_structure/find_field_structure/FindFieldStructureRequest.ts Co-authored-by: Florian Bernd --- .../find_field_structure/FindFieldStructureRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts index 7d9fc75cfc..db1dd30213 100644 --- a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts +++ b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts @@ -67,7 +67,7 @@ interface Request extends RequestBase { /** * The field that should be analyzed. */ - field: string + field: Field /** * The high level structure of the text. * By default, the API chooses the format. From e0c81b1872cd85141fd88fd97fa3f47af2cf7168 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 18 Dec 2024 18:19:29 -0800 Subject: [PATCH 4/6] Update specification/text_structure/find_field_structure/FindFieldStructureRequest.ts Co-authored-by: Florian Bernd --- .../find_field_structure/FindFieldStructureRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts index db1dd30213..8e920bdb18 100644 --- a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts +++ b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts @@ -85,7 +85,7 @@ interface Request extends RequestBase { /** * The name of the index that contains the analyzed field. */ - index: string + index: IndexName /** * If the format is `delimited`, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character. * Only a single character is supported. From 74e613f369dc49466d841ce76d9e2401f210be65 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 18 Dec 2024 18:19:41 -0800 Subject: [PATCH 5/6] Update specification/text_structure/find_field_structure/FindFieldStructureRequest.ts Co-authored-by: Florian Bernd --- .../find_field_structure/FindFieldStructureRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts index 8e920bdb18..aa8e638126 100644 --- a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts +++ b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts @@ -117,7 +117,7 @@ interface Request extends RequestBase { * If this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field. * For structured text, it is not compulsory to have a timestamp in the text. */ - timestamp_field?: string + timestamp_field?: Field /** * The Java time format of the timestamp field in the text. * Only a subset of Java time format letter groups are supported: From 195fc456a2d5976e6f63811b179c90c958f54487 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 18 Dec 2024 18:51:40 -0800 Subject: [PATCH 6/6] Add response properties and shared types --- output/openapi/elasticsearch-openapi.json | 180 ++++- output/schema/schema.json | 700 +++++++++++++----- output/typescript/types.ts | 88 ++- specification/_doc_ids/table.csv | 2 + .../types.ts => _types/Structure.ts} | 12 + .../FindFieldStructureRequest.ts | 17 +- .../FindFieldStructureResponse.ts | 30 +- .../FindMessageStructureRequest.ts | 15 +- .../FindMessageStructureResponse.ts | 30 +- .../find_structure/FindStructureResponse.ts | 2 +- 10 files changed, 801 insertions(+), 275 deletions(-) rename specification/text_structure/{find_structure/types.ts => _types/Structure.ts} (89%) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index ef9cc80474..5ff220f9b2 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -34277,7 +34277,7 @@ "description": "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of the meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output.\nThe intention in that situation is that a user who knows the meanings will rename the fields before using them.", "deprecated": false, "schema": { - "$ref": "#/components/schemas/text_structure.find_field_structure:EcsCompatibilityType" + "$ref": "#/components/schemas/text_structure._types:EcsCompatibilityType" }, "style": "form" }, @@ -34298,7 +34298,7 @@ "required": true, "deprecated": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/_types:Field" }, "style": "form" }, @@ -34308,7 +34308,7 @@ "description": "The high level structure of the text.\nBy default, the API chooses the format.\nIn this default scenario, all rows must have the same number of fields for a delimited format to be detected.\nIf the format is set to delimited and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row.", "deprecated": false, "schema": { - "$ref": "#/components/schemas/text_structure.find_field_structure:FormatType" + "$ref": "#/components/schemas/text_structure._types:FormatType" }, "style": "form" }, @@ -34329,7 +34329,7 @@ "required": true, "deprecated": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/_types:IndexName" }, "style": "form" }, @@ -34369,7 +34369,7 @@ "description": "The name of the field that contains the primary timestamp of each record in the text.\nIn particular, if the text was ingested into an index, this is the field that would be used to populate the `@timestamp` field.\n\nIf the format is `semi_structured_text`, this field must match the name of the appropriate extraction in the `grok_pattern`.\nTherefore, for semi-structured text, it is best not to specify this parameter unless `grok_pattern` is also specified.\n\nFor structured text, if you specify this parameter, the field must exist within the text.\n\nIf this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field.\nFor structured text, it is not compulsory to have a timestamp in the text.", "deprecated": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/_types:Field" }, "style": "form" }, @@ -34390,7 +34390,74 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "properties": { + "charset": { + "type": "string" + }, + "ecs_compatibility": { + "$ref": "#/components/schemas/text_structure._types:EcsCompatibilityType" + }, + "field_stats": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/text_structure._types:FieldStat" + } + }, + "format": { + "$ref": "#/components/schemas/text_structure._types:FormatType" + }, + "grok_pattern": { + "$ref": "#/components/schemas/_types:GrokPattern" + }, + "java_timestamp_formats": { + "type": "array", + "items": { + "type": "string" + } + }, + "joda_timestamp_formats": { + "type": "array", + "items": { + "type": "string" + } + }, + "ingest_pipeline": { + "$ref": "#/components/schemas/ingest._types:PipelineConfig" + }, + "mappings": { + "$ref": "#/components/schemas/_types.mapping:TypeMapping" + }, + "multiline_start_pattern": { + "type": "string" + }, + "need_client_timezone": { + "type": "boolean" + }, + "num_lines_analyzed": { + "type": "number" + }, + "num_messages_analyzed": { + "type": "number" + }, + "sample_start": { + "type": "string" + }, + "timestamp_field": { + "$ref": "#/components/schemas/_types:Field" + } + }, + "required": [ + "charset", + "field_stats", + "format", + "ingest_pipeline", + "mappings", + "need_client_timezone", + "num_lines_analyzed", + "num_messages_analyzed", + "sample_start" + ] } } } @@ -34698,7 +34765,7 @@ "field_stats": { "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/text_structure.find_structure:FieldStat" + "$ref": "#/components/schemas/text_structure._types:FieldStat" } }, "sample_start": { @@ -86389,30 +86456,14 @@ "none" ] }, - "text_structure.find_field_structure:EcsCompatibilityType": { - "type": "string", - "enum": [ - "disabled", - "v1" - ] - }, - "text_structure.find_field_structure:FormatType": { - "type": "string", - "enum": [ - "delimited", - "ndjson", - "semi_structured_text", - "xml" - ] - }, - "text_structure.find_message_structure:EcsCompatibilityType": { + "text_structure._types:EcsCompatibilityType": { "type": "string", "enum": [ "disabled", "v1" ] }, - "text_structure.find_message_structure:FormatType": { + "text_structure._types:FormatType": { "type": "string", "enum": [ "delimited", @@ -86421,7 +86472,7 @@ "xml" ] }, - "text_structure.find_structure:FieldStat": { + "text_structure._types:FieldStat": { "type": "object", "properties": { "count": { @@ -86433,7 +86484,7 @@ "top_hits": { "type": "array", "items": { - "$ref": "#/components/schemas/text_structure.find_structure:TopHit" + "$ref": "#/components/schemas/text_structure._types:TopHit" } }, "mean_value": { @@ -86461,7 +86512,7 @@ "top_hits" ] }, - "text_structure.find_structure:TopHit": { + "text_structure._types:TopHit": { "type": "object", "properties": { "count": { @@ -93889,7 +93940,74 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "properties": { + "charset": { + "type": "string" + }, + "ecs_compatibility": { + "$ref": "#/components/schemas/text_structure._types:EcsCompatibilityType" + }, + "field_stats": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/text_structure._types:FieldStat" + } + }, + "format": { + "$ref": "#/components/schemas/text_structure._types:FormatType" + }, + "grok_pattern": { + "$ref": "#/components/schemas/_types:GrokPattern" + }, + "java_timestamp_formats": { + "type": "array", + "items": { + "type": "string" + } + }, + "joda_timestamp_formats": { + "type": "array", + "items": { + "type": "string" + } + }, + "ingest_pipeline": { + "$ref": "#/components/schemas/ingest._types:PipelineConfig" + }, + "mappings": { + "$ref": "#/components/schemas/_types.mapping:TypeMapping" + }, + "multiline_start_pattern": { + "type": "string" + }, + "need_client_timezone": { + "type": "boolean" + }, + "num_lines_analyzed": { + "type": "number" + }, + "num_messages_analyzed": { + "type": "number" + }, + "sample_start": { + "type": "string" + }, + "timestamp_field": { + "$ref": "#/components/schemas/_types:Field" + } + }, + "required": [ + "charset", + "field_stats", + "format", + "ingest_pipeline", + "mappings", + "need_client_timezone", + "num_lines_analyzed", + "num_messages_analyzed", + "sample_start" + ] } } } @@ -103301,7 +103419,7 @@ "description": "The mode of compatibility with ECS compliant Grok patterns.\nUse this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern.\nThis setting primarily has an impact when a whole message Grok pattern such as `%{CATALINALOG}` matches the input.\nIf the structure finder identifies a common structure but has no idea of meaning then generic field names such as `path`, `ipaddress`, `field1`, and `field2` are used in the `grok_pattern` output, with the intention that a user who knows the meanings rename these fields before using it.", "deprecated": false, "schema": { - "$ref": "#/components/schemas/text_structure.find_message_structure:EcsCompatibilityType" + "$ref": "#/components/schemas/text_structure._types:EcsCompatibilityType" }, "style": "form" }, @@ -103321,7 +103439,7 @@ "description": "The high level structure of the text.\nBy default, the API chooses the format.\nIn this default scenario, all rows must have the same number of fields for a delimited format to be detected.\nIf the format is `delimited` and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row.", "deprecated": false, "schema": { - "$ref": "#/components/schemas/text_structure.find_message_structure:FormatType" + "$ref": "#/components/schemas/text_structure._types:FormatType" }, "style": "form" }, diff --git a/output/schema/schema.json b/output/schema/schema.json index fab6f031ff..90696cd146 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -19572,7 +19572,8 @@ } }, "description": "Find the structure of a text field.\nFind the structure of a text field in an Elasticsearch index.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/find-field-structure.html", + "docId": "find-field-structure", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/find-field-structure.html", "name": "text_structure.find_field_structure", "privileges": { "cluster": [ @@ -19608,7 +19609,8 @@ } }, "description": "Find the structure of text messages.\nFind the structure of a list of text messages.\nThe messages must contain data that is suitable to be ingested into Elasticsearch.\n\nThis API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.\nUse this API rather than the find text structure API if your input text has already been split up into separate messages by some other process.\nThe response from the API contains:\n\n* Sample messages.\n* Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.\n* Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.\nAppropriate mappings for an Elasticsearch index, which you could use to ingest the text.\n\nAll this information can be calculated by the structure finder with no guidance.\nHowever, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/find-message-structure.html", + "docId": "find-message-structure", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/find-message-structure.html", "name": "text_structure.find_message_structure", "privileges": { "cluster": [ @@ -209155,9 +209157,121 @@ ], "name": { "name": "EcsCompatibilityType", - "namespace": "text_structure.find_field_structure" + "namespace": "text_structure._types" + }, + "specLocation": "text_structure/_types/Structure.ts#L40-L43" + }, + { + "kind": "interface", + "name": { + "name": "FieldStat", + "namespace": "text_structure._types" }, - "specLocation": "text_structure/find_field_structure/FindFieldStructureRequest.ts#L161-L164" + "properties": [ + { + "name": "count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "cardinality", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "top_hits", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "TopHit", + "namespace": "text_structure._types" + } + } + } + }, + { + "name": "mean_value", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "median_value", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "max_value", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "min_value", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "earliest", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "latest", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "text_structure/_types/Structure.ts#L23-L33" }, { "kind": "enum", @@ -209177,9 +209291,37 @@ ], "name": { "name": "FormatType", - "namespace": "text_structure.find_field_structure" + "namespace": "text_structure._types" + }, + "specLocation": "text_structure/_types/Structure.ts#L45-L50" + }, + { + "kind": "interface", + "name": { + "name": "TopHit", + "namespace": "text_structure._types" }, - "specLocation": "text_structure/find_field_structure/FindFieldStructureRequest.ts#L166-L171" + "properties": [ + { + "name": "count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "value", + "required": true, + "type": { + "kind": "user_defined_value" + } + } + ], + "specLocation": "text_structure/_types/Structure.ts#L35-L38" }, { "kind": "request", @@ -209248,7 +209390,7 @@ "kind": "instance_of", "type": { "name": "EcsCompatibilityType", - "namespace": "text_structure.find_field_structure" + "namespace": "text_structure._types" } } }, @@ -209272,8 +209414,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "Field", + "namespace": "_types" } } }, @@ -209285,7 +209427,7 @@ "kind": "instance_of", "type": { "name": "FormatType", - "namespace": "text_structure.find_field_structure" + "namespace": "text_structure._types" } } }, @@ -209308,8 +209450,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "IndexName", + "namespace": "_types" } } }, @@ -209357,8 +209499,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "Field", + "namespace": "_types" } } }, @@ -209375,57 +209517,202 @@ } } ], - "specLocation": "text_structure/find_field_structure/FindFieldStructureRequest.ts#L24-L159" + "specLocation": "text_structure/find_field_structure/FindFieldStructureRequest.ts#L26-L162" }, { "kind": "response", "body": { "kind": "properties", - "properties": [] + "properties": [ + { + "name": "charset", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "ecs_compatibility", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "EcsCompatibilityType", + "namespace": "text_structure._types" + } + } + }, + { + "name": "field_stats", + "required": true, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "FieldStat", + "namespace": "text_structure._types" + } + } + } + }, + { + "name": "format", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FormatType", + "namespace": "text_structure._types" + } + } + }, + { + "name": "grok_pattern", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GrokPattern", + "namespace": "_types" + } + } + }, + { + "name": "java_timestamp_formats", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "name": "joda_timestamp_formats", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "name": "ingest_pipeline", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "PipelineConfig", + "namespace": "ingest._types" + } + } + }, + { + "name": "mappings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "TypeMapping", + "namespace": "_types.mapping" + } + } + }, + { + "name": "multiline_start_pattern", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "need_client_timezone", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "num_lines_analyzed", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "num_messages_analyzed", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "sample_start", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "timestamp_field", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + } + } + ] }, "name": { "name": "Response", "namespace": "text_structure.find_field_structure" }, - "specLocation": "text_structure/find_field_structure/FindFieldStructureResponse.ts#L19-L21" - }, - { - "kind": "enum", - "members": [ - { - "name": "disabled" - }, - { - "name": "v1" - } - ], - "name": { - "name": "EcsCompatibilityType", - "namespace": "text_structure.find_message_structure" - }, - "specLocation": "text_structure/find_message_structure/FindMessageStructureRequest.ts#L162-L165" - }, - { - "kind": "enum", - "members": [ - { - "name": "delimited" - }, - { - "name": "ndjson" - }, - { - "name": "semi_structured_text" - }, - { - "name": "xml" - } - ], - "name": { - "name": "FormatType", - "namespace": "text_structure.find_message_structure" - }, - "specLocation": "text_structure/find_message_structure/FindMessageStructureRequest.ts#L167-L172" + "specLocation": "text_structure/find_field_structure/FindFieldStructureResponse.ts#L31-L49" }, { "kind": "request", @@ -209498,7 +209785,7 @@ "kind": "instance_of", "type": { "name": "EcsCompatibilityType", - "namespace": "text_structure.find_message_structure" + "namespace": "text_structure._types" } } }, @@ -209523,7 +209810,7 @@ "kind": "instance_of", "type": { "name": "FormatType", - "namespace": "text_structure.find_message_structure" + "namespace": "text_structure._types" } } }, @@ -209601,131 +209888,202 @@ } } ], - "specLocation": "text_structure/find_message_structure/FindMessageStructureRequest.ts#L23-L160" + "specLocation": "text_structure/find_message_structure/FindMessageStructureRequest.ts#L25-L163" }, { "kind": "response", "body": { "kind": "properties", - "properties": [] - }, - "name": { - "name": "Response", - "namespace": "text_structure.find_message_structure" - }, - "specLocation": "text_structure/find_message_structure/FindMessageStructureResponse.ts#L19-L21" - }, - { - "kind": "interface", - "name": { - "name": "FieldStat", - "namespace": "text_structure.find_structure" - }, - "properties": [ - { - "name": "count", - "required": true, - "type": { - "kind": "instance_of", + "properties": [ + { + "name": "charset", + "required": true, "type": { - "name": "integer", - "namespace": "_types" + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } } - } - }, - { - "name": "cardinality", - "required": true, - "type": { - "kind": "instance_of", + }, + { + "name": "ecs_compatibility", + "required": false, "type": { - "name": "integer", - "namespace": "_types" + "kind": "instance_of", + "type": { + "name": "EcsCompatibilityType", + "namespace": "text_structure._types" + } } - } - }, - { - "name": "top_hits", - "required": true, - "type": { - "kind": "array_of", - "value": { + }, + { + "name": "field_stats", + "required": true, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "FieldStat", + "namespace": "text_structure._types" + } + } + } + }, + { + "name": "format", + "required": true, + "type": { "kind": "instance_of", "type": { - "name": "TopHit", - "namespace": "text_structure.find_structure" + "name": "FormatType", + "namespace": "text_structure._types" } } - } - }, - { - "name": "mean_value", - "required": false, - "type": { - "kind": "instance_of", + }, + { + "name": "grok_pattern", + "required": false, "type": { - "name": "integer", - "namespace": "_types" + "kind": "instance_of", + "type": { + "name": "GrokPattern", + "namespace": "_types" + } } - } - }, - { - "name": "median_value", - "required": false, - "type": { - "kind": "instance_of", + }, + { + "name": "java_timestamp_formats", + "required": false, "type": { - "name": "integer", - "namespace": "_types" + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } } - } - }, - { - "name": "max_value", - "required": false, - "type": { - "kind": "instance_of", + }, + { + "name": "joda_timestamp_formats", + "required": false, "type": { - "name": "integer", - "namespace": "_types" + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } } - } - }, - { - "name": "min_value", - "required": false, - "type": { - "kind": "instance_of", + }, + { + "name": "ingest_pipeline", + "required": true, "type": { - "name": "integer", - "namespace": "_types" + "kind": "instance_of", + "type": { + "name": "PipelineConfig", + "namespace": "ingest._types" + } } - } - }, - { - "name": "earliest", - "required": false, - "type": { - "kind": "instance_of", + }, + { + "name": "mappings", + "required": true, "type": { - "name": "string", - "namespace": "_builtins" + "kind": "instance_of", + "type": { + "name": "TypeMapping", + "namespace": "_types.mapping" + } } - } - }, - { - "name": "latest", - "required": false, - "type": { - "kind": "instance_of", + }, + { + "name": "multiline_start_pattern", + "required": false, "type": { - "name": "string", - "namespace": "_builtins" + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "need_client_timezone", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "num_lines_analyzed", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "num_messages_analyzed", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "sample_start", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "timestamp_field", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } } } - } - ], - "specLocation": "text_structure/find_structure/types.ts#L23-L33" + ] + }, + "name": { + "name": "Response", + "namespace": "text_structure.find_message_structure" + }, + "specLocation": "text_structure/find_message_structure/FindMessageStructureResponse.ts#L31-L49" }, { "kind": "request", @@ -210009,7 +210367,7 @@ "kind": "instance_of", "type": { "name": "FieldStat", - "namespace": "text_structure.find_structure" + "namespace": "text_structure._types" } } } @@ -210221,34 +210579,6 @@ }, "specLocation": "text_structure/find_structure/FindStructureResponse.ts#L27-L52" }, - { - "kind": "interface", - "name": { - "name": "TopHit", - "namespace": "text_structure.find_structure" - }, - "properties": [ - { - "name": "count", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "value", - "required": true, - "type": { - "kind": "user_defined_value" - } - } - ], - "specLocation": "text_structure/find_structure/types.ts#L35-L38" - }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index e19e7185b3..8db45ff237 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -19792,40 +19792,68 @@ export interface TasksListRequest extends RequestBase { export type TasksListResponse = TasksTaskListResponseBase -export type TextStructureFindFieldStructureEcsCompatibilityType = 'disabled' | 'v1' +export type TextStructureEcsCompatibilityType = 'disabled' | 'v1' -export type TextStructureFindFieldStructureFormatType = 'delimited' | 'ndjson' | 'semi_structured_text' | 'xml' +export interface TextStructureFieldStat { + count: integer + cardinality: integer + top_hits: TextStructureTopHit[] + mean_value?: integer + median_value?: integer + max_value?: integer + min_value?: integer + earliest?: string + latest?: string +} + +export type TextStructureFormatType = 'delimited' | 'ndjson' | 'semi_structured_text' | 'xml' + +export interface TextStructureTopHit { + count: long + value: any +} export interface TextStructureFindFieldStructureRequest extends RequestBase { column_names?: string delimiter?: string documents_to_sample?: uint - ecs_compatibility?: TextStructureFindFieldStructureEcsCompatibilityType + ecs_compatibility?: TextStructureEcsCompatibilityType explain?: boolean - field: string - format?: TextStructureFindFieldStructureFormatType + field: Field + format?: TextStructureFormatType grok_pattern?: GrokPattern - index: string + index: IndexName quote?: string should_trim_fields?: boolean timeout?: Duration - timestamp_field?: string + timestamp_field?: Field timestamp_format?: string } export interface TextStructureFindFieldStructureResponse { + charset: string + ecs_compatibility?: TextStructureEcsCompatibilityType + field_stats: Record + format: TextStructureFormatType + grok_pattern?: GrokPattern + java_timestamp_formats?: string[] + joda_timestamp_formats?: string[] + ingest_pipeline: IngestPipelineConfig + mappings: MappingTypeMapping + multiline_start_pattern?: string + need_client_timezone: boolean + num_lines_analyzed: integer + num_messages_analyzed: integer + sample_start: string + timestamp_field?: Field } -export type TextStructureFindMessageStructureEcsCompatibilityType = 'disabled' | 'v1' - -export type TextStructureFindMessageStructureFormatType = 'delimited' | 'ndjson' | 'semi_structured_text' | 'xml' - export interface TextStructureFindMessageStructureRequest extends RequestBase { column_names?: string delimiter?: string - ecs_compatibility?: TextStructureFindMessageStructureEcsCompatibilityType + ecs_compatibility?: TextStructureEcsCompatibilityType explain?: boolean - format?: TextStructureFindMessageStructureFormatType + format?: TextStructureFormatType grok_pattern?: GrokPattern quote?: string should_trim_fields?: boolean @@ -19838,18 +19866,21 @@ export interface TextStructureFindMessageStructureRequest extends RequestBase { } export interface TextStructureFindMessageStructureResponse { -} - -export interface TextStructureFindStructureFieldStat { - count: integer - cardinality: integer - top_hits: TextStructureFindStructureTopHit[] - mean_value?: integer - median_value?: integer - max_value?: integer - min_value?: integer - earliest?: string - latest?: string + charset: string + ecs_compatibility?: TextStructureEcsCompatibilityType + field_stats: Record + format: TextStructureFormatType + grok_pattern?: GrokPattern + java_timestamp_formats?: string[] + joda_timestamp_formats?: string[] + ingest_pipeline: IngestPipelineConfig + mappings: MappingTypeMapping + multiline_start_pattern?: string + need_client_timezone: boolean + num_lines_analyzed: integer + num_messages_analyzed: integer + sample_start: string + timestamp_field?: Field } export interface TextStructureFindStructureRequest { @@ -19876,7 +19907,7 @@ export interface TextStructureFindStructureResponse { has_header_row?: boolean has_byte_order_marker: boolean format: string - field_stats: Record + field_stats: Record sample_start: string num_messages_analyzed: integer mappings: MappingTypeMapping @@ -19896,11 +19927,6 @@ export interface TextStructureFindStructureResponse { ingest_pipeline: IngestPipelineConfig } -export interface TextStructureFindStructureTopHit { - count: long - value: any -} - export interface TextStructureTestGrokPatternMatchedField { match: string offset: integer diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index c5e2657a50..4c90a8493d 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -166,6 +166,8 @@ explain-dfanalytics,https://www.elastic.co/guide/en/elasticsearch/reference/{bra fail-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/fail-processor.html field-and-document-access-control,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/field-and-document-access-control.html field-usage-stats,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/field-usage-stats.html +find-field-structure,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/find-field-structure.html +find-message-structure,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/find-message-structure.html find-structure,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/find-structure.html fingerprint-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/fingerprint-processor.html foreach-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/foreach-processor.html diff --git a/specification/text_structure/find_structure/types.ts b/specification/text_structure/_types/Structure.ts similarity index 89% rename from specification/text_structure/find_structure/types.ts rename to specification/text_structure/_types/Structure.ts index 2ba85e0c30..056550d2ae 100644 --- a/specification/text_structure/find_structure/types.ts +++ b/specification/text_structure/_types/Structure.ts @@ -36,3 +36,15 @@ export class TopHit { count: long value: UserDefinedValue } + +export enum EcsCompatibilityType { + disabled, + v1 +} + +export enum FormatType { + delimited, + ndjson, + semi_structured_text, + xml +} diff --git a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts index aa8e638126..91896ed653 100644 --- a/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts +++ b/specification/text_structure/find_field_structure/FindFieldStructureRequest.ts @@ -18,15 +18,18 @@ */ import { RequestBase } from '@_types/Base' -import { GrokPattern } from '@_types/common' +import { Field, GrokPattern, IndexName } from '@_types/common' import { uint } from '@_types/Numeric' import { Duration } from '@_types/Time' +import { EcsCompatibilityType, FormatType } from '../_types/Structure' + /** * Find the structure of a text field. * Find the structure of a text field in an Elasticsearch index. * @rest_spec_name text_structure.find_field_structure * @availability stack stability=stable visibility=public * @cluster_privileges monitor_text_structure + * @doc_id find-field-structure */ interface Request extends RequestBase { query_parameters: { @@ -157,15 +160,3 @@ interface Request extends RequestBase { timestamp_format?: string } } - -export enum EcsCompatibilityType { - disabled, - v1 -} - -export enum FormatType { - delimited, - ndjson, - semi_structured_text, - xml -} diff --git a/specification/text_structure/find_field_structure/FindFieldStructureResponse.ts b/specification/text_structure/find_field_structure/FindFieldStructureResponse.ts index 598b913c3e..258bb7e146 100644 --- a/specification/text_structure/find_field_structure/FindFieldStructureResponse.ts +++ b/specification/text_structure/find_field_structure/FindFieldStructureResponse.ts @@ -16,6 +16,34 @@ * specific language governing permissions and limitations * under the License. */ + +import { PipelineConfig } from '@ingest/_types/Pipeline' +import { Dictionary } from '@spec_utils/Dictionary' +import { Field, GrokPattern } from '@_types/common' +import { TypeMapping } from '@_types/mapping/TypeMapping' +import { integer } from '@_types/Numeric' +import { + EcsCompatibilityType, + FieldStat, + FormatType +} from '../_types/Structure' + export class Response { - body: {} + body: { + charset: string + ecs_compatibility?: EcsCompatibilityType + field_stats: Dictionary + format: FormatType + grok_pattern?: GrokPattern + java_timestamp_formats?: string[] + joda_timestamp_formats?: string[] + ingest_pipeline: PipelineConfig + mappings: TypeMapping + multiline_start_pattern?: string + need_client_timezone: boolean + num_lines_analyzed: integer + num_messages_analyzed: integer + sample_start: string + timestamp_field?: Field + } } diff --git a/specification/text_structure/find_message_structure/FindMessageStructureRequest.ts b/specification/text_structure/find_message_structure/FindMessageStructureRequest.ts index 420377b3fc..df08f3fe29 100644 --- a/specification/text_structure/find_message_structure/FindMessageStructureRequest.ts +++ b/specification/text_structure/find_message_structure/FindMessageStructureRequest.ts @@ -20,6 +20,8 @@ import { RequestBase } from '@_types/Base' import { Field, GrokPattern } from '@_types/common' import { Duration } from '@_types/Time' +import { EcsCompatibilityType, FormatType } from '../_types/Structure' + /** * Find the structure of text messages. * Find the structure of a list of text messages. @@ -39,6 +41,7 @@ import { Duration } from '@_types/Time' * @rest_spec_name text_structure.find_message_structure * @availability stack stability=stable visibility=public * @cluster_privileges monitor_text_structure + * @doc_id find-message-structure */ interface Request extends RequestBase { query_parameters: { @@ -158,15 +161,3 @@ interface Request extends RequestBase { messages: Array } } - -export enum EcsCompatibilityType { - disabled, - v1 -} - -export enum FormatType { - delimited, - ndjson, - semi_structured_text, - xml -} diff --git a/specification/text_structure/find_message_structure/FindMessageStructureResponse.ts b/specification/text_structure/find_message_structure/FindMessageStructureResponse.ts index 598b913c3e..258bb7e146 100644 --- a/specification/text_structure/find_message_structure/FindMessageStructureResponse.ts +++ b/specification/text_structure/find_message_structure/FindMessageStructureResponse.ts @@ -16,6 +16,34 @@ * specific language governing permissions and limitations * under the License. */ + +import { PipelineConfig } from '@ingest/_types/Pipeline' +import { Dictionary } from '@spec_utils/Dictionary' +import { Field, GrokPattern } from '@_types/common' +import { TypeMapping } from '@_types/mapping/TypeMapping' +import { integer } from '@_types/Numeric' +import { + EcsCompatibilityType, + FieldStat, + FormatType +} from '../_types/Structure' + export class Response { - body: {} + body: { + charset: string + ecs_compatibility?: EcsCompatibilityType + field_stats: Dictionary + format: FormatType + grok_pattern?: GrokPattern + java_timestamp_formats?: string[] + joda_timestamp_formats?: string[] + ingest_pipeline: PipelineConfig + mappings: TypeMapping + multiline_start_pattern?: string + need_client_timezone: boolean + num_lines_analyzed: integer + num_messages_analyzed: integer + sample_start: string + timestamp_field?: Field + } } diff --git a/specification/text_structure/find_structure/FindStructureResponse.ts b/specification/text_structure/find_structure/FindStructureResponse.ts index b6fb84d5a9..b3cdeb9160 100644 --- a/specification/text_structure/find_structure/FindStructureResponse.ts +++ b/specification/text_structure/find_structure/FindStructureResponse.ts @@ -22,7 +22,7 @@ import { Dictionary } from '@spec_utils/Dictionary' import { Field, GrokPattern } from '@_types/common' import { TypeMapping } from '@_types/mapping/TypeMapping' import { integer } from '@_types/Numeric' -import { FieldStat } from './types' +import { FieldStat } from '../_types/Structure' export class Response { body: {