# `TextStructure` [class-TextStructure] ## Constructor ```typescript new TextStructure(transport: [Transport](./Transport.md)); ``` ## Properties [class-properties-TextStructure] | Name | Type | Description | | - | - | - | | `acceptedParams` | Record |   | | `transport` | [Transport](./Transport.md) |   | ## Methods [class-methods-TextStructure] | Name | Signature | Description | | - | - | - | | `findFieldStructure` | `findFieldStructure(this: [That](./That.md), params: [TextStructureFindFieldStructureRequest](./TextStructureFindFieldStructureRequest.md), options?: [TransportRequestOptionsWithOutMeta](./TransportRequestOptionsWithOutMeta.md)): Promise<[TextStructureFindFieldStructureResponse](./TextStructureFindFieldStructureResponse.md)>;` | Find the structure of a text field. Find the structure of a text field in an Elasticsearch index. This API provides a starting point for extracting further information from log messages already ingested into Elasticsearch. For example, if you have ingested data into a very simple index that has just `@timestamp` and message fields, you can use this API to see what common structure exists in the message field. 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. If the structure finder produces unexpected results, specify the `explain` query parameter and an explanation will appear in the response. It helps determine why the returned structure was chosen. | | `findFieldStructure` | `findFieldStructure(this: [That](./That.md), params: [TextStructureFindFieldStructureRequest](./TextStructureFindFieldStructureRequest.md), options?: [TransportRequestOptionsWithMeta](./TransportRequestOptionsWithMeta.md)): Promise<[TransportResult](./TransportResult.md)<[TextStructureFindFieldStructureResponse](./TextStructureFindFieldStructureResponse.md), unknown>>;` |   | | `findFieldStructure` | `findFieldStructure(this: [That](./That.md), params: [TextStructureFindFieldStructureRequest](./TextStructureFindFieldStructureRequest.md), options?: [TransportRequestOptions](./TransportRequestOptions.md)): Promise<[TextStructureFindFieldStructureResponse](./TextStructureFindFieldStructureResponse.md)>;` |   | | `findMessageStructure` | `findMessageStructure(this: [That](./That.md), params: [TextStructureFindMessageStructureRequest](./TextStructureFindMessageStructureRequest.md), options?: [TransportRequestOptionsWithOutMeta](./TransportRequestOptionsWithOutMeta.md)): Promise<[TextStructureFindMessageStructureResponse](./TextStructureFindMessageStructureResponse.md)>;` | 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. If the structure finder produces unexpected results, specify the `explain` query parameter and an explanation will appear in the response. It helps determine why the returned structure was chosen. | | `findMessageStructure` | `findMessageStructure(this: [That](./That.md), params: [TextStructureFindMessageStructureRequest](./TextStructureFindMessageStructureRequest.md), options?: [TransportRequestOptionsWithMeta](./TransportRequestOptionsWithMeta.md)): Promise<[TransportResult](./TransportResult.md)<[TextStructureFindMessageStructureResponse](./TextStructureFindMessageStructureResponse.md), unknown>>;` |   | | `findMessageStructure` | `findMessageStructure(this: [That](./That.md), params: [TextStructureFindMessageStructureRequest](./TextStructureFindMessageStructureRequest.md), options?: [TransportRequestOptions](./TransportRequestOptions.md)): Promise<[TextStructureFindMessageStructureResponse](./TextStructureFindMessageStructureResponse.md)>;` |   | | `findStructure` | `findStructure(this: [That](./That.md), params: [TextStructureFindStructureRequest](./TextStructureFindStructureRequest.md), options?: [TransportRequestOptionsWithOutMeta](./TransportRequestOptionsWithOutMeta.md)): Promise<[TextStructureFindStructureResponse](./TextStructureFindStructureResponse.md)>;` | Find the structure of a text file. The text file 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. Unlike other Elasticsearch endpoints, the data that is posted to this endpoint does not need to be UTF-8 encoded and in JSON format. It must, however, be text; binary text formats are not currently supported. The size is limited to the Elasticsearch HTTP receive buffer size, which defaults to 100 Mb. The response from the API contains: * A couple of messages from the beginning of the text. * 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. | | `findStructure` | `findStructure(this: [That](./That.md), params: [TextStructureFindStructureRequest](./TextStructureFindStructureRequest.md), options?: [TransportRequestOptionsWithMeta](./TransportRequestOptionsWithMeta.md)): Promise<[TransportResult](./TransportResult.md)<[TextStructureFindStructureResponse](./TextStructureFindStructureResponse.md), unknown>>;` |   | | `findStructure` | `findStructure(this: [That](./That.md), params: [TextStructureFindStructureRequest](./TextStructureFindStructureRequest.md), options?: [TransportRequestOptions](./TransportRequestOptions.md)): Promise<[TextStructureFindStructureResponse](./TextStructureFindStructureResponse.md)>;` |   | | `testGrokPattern` | `testGrokPattern(this: [That](./That.md), params: [TextStructureTestGrokPatternRequest](./TextStructureTestGrokPatternRequest.md), options?: [TransportRequestOptionsWithOutMeta](./TransportRequestOptionsWithOutMeta.md)): Promise<[TextStructureTestGrokPatternResponse](./TextStructureTestGrokPatternResponse.md)>;` | Test a Grok pattern. Test a Grok pattern on one or more lines of text. The API indicates whether the lines match the pattern together with the offsets and lengths of the matched substrings. | | `testGrokPattern` | `testGrokPattern(this: [That](./That.md), params: [TextStructureTestGrokPatternRequest](./TextStructureTestGrokPatternRequest.md), options?: [TransportRequestOptionsWithMeta](./TransportRequestOptionsWithMeta.md)): Promise<[TransportResult](./TransportResult.md)<[TextStructureTestGrokPatternResponse](./TextStructureTestGrokPatternResponse.md), unknown>>;` |   | | `testGrokPattern` | `testGrokPattern(this: [That](./That.md), params: [TextStructureTestGrokPatternRequest](./TextStructureTestGrokPatternRequest.md), options?: [TransportRequestOptions](./TransportRequestOptions.md)): Promise<[TextStructureTestGrokPatternResponse](./TextStructureTestGrokPatternResponse.md)>;` |   |