Class ElasticsearchTextStructureClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchTextStructureClient
(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptionFind the structure of a text field.findFieldStructure
(Function<FindFieldStructureRequest.Builder, ObjectBuilder<FindFieldStructureRequest>> fn) Find the structure of a text field.Find the structure of text messages.findMessageStructure
(Function<FindMessageStructureRequest.Builder, ObjectBuilder<FindMessageStructureRequest>> fn) Find the structure of text messages.testGrokPattern
(TestGrokPatternRequest request) Test a Grok pattern.final TestGrokPatternResponse
Test a Grok pattern.withTransportOptions
(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, close, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchTextStructureClient
-
ElasticsearchTextStructureClient
public ElasticsearchTextStructureClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
public ElasticsearchTextStructureClient withTransportOptions(@Nullable TransportOptions transportOptions) Description copied from class:ApiClient
Creates a new client with some request options- Specified by:
withTransportOptions
in classApiClient<ElasticsearchTransport,
ElasticsearchTextStructureClient>
-
findFieldStructure
public FindFieldStructureResponse findFieldStructure(FindFieldStructureRequest request) throws IOException, ElasticsearchException 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.- Throws:
IOException
ElasticsearchException
- See Also:
-
findFieldStructure
public final FindFieldStructureResponse findFieldStructure(Function<FindFieldStructureRequest.Builder, ObjectBuilder<FindFieldStructureRequest>> fn) throws IOException, ElasticsearchExceptionFind 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.- Parameters:
fn
- a function that initializes a builder to create theFindFieldStructureRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
findMessageStructure
public FindMessageStructureResponse findMessageStructure(FindMessageStructureRequest request) throws IOException, ElasticsearchException 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.- Throws:
IOException
ElasticsearchException
- See Also:
-
findMessageStructure
public final FindMessageStructureResponse findMessageStructure(Function<FindMessageStructureRequest.Builder, ObjectBuilder<FindMessageStructureRequest>> fn) throws IOException, ElasticsearchExceptionFind 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.- Parameters:
fn
- a function that initializes a builder to create theFindMessageStructureRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
testGrokPattern
public TestGrokPatternResponse testGrokPattern(TestGrokPatternRequest request) throws IOException, ElasticsearchException 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.- Throws:
IOException
ElasticsearchException
- See Also:
-
testGrokPattern
public final TestGrokPatternResponse testGrokPattern(Function<TestGrokPatternRequest.Builder, ObjectBuilder<TestGrokPatternRequest>> fn) throws IOException, ElasticsearchExceptionTest 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.- Parameters:
fn
- a function that initializes a builder to create theTestGrokPatternRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-