elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.39k stars 24.87k forks source link

ESQL: Allow access to failure store #108559

Open flash1293 opened 6 months ago

flash1293 commented 6 months ago

Description

The failure store is a very new experimental data stream feature that captures documents that couldn't be indexed and stores them in a special index with a fixed mapping in the failure store.

Certain key APIs like search or field caps gain a new argument failure_store, which can be used to include it into queries:

GET logs-mystream-prod/_search?failure_store=only
GET logs-mystream-prod/_search?failure_store=include
GET logs-mystream-prod/_search?failure_store=exclude # default

This allows users to troubleshoot ingestion problems and possibly even re-index failed documents after the fact.

As it needs to be possible to browse the documents in the failure store, it should be possible to query it from ESQL to be able to use all the regular tooling (Discover, Alerts, ...)

Some unstructured thoughts how that could work

I'm not sure about the right approach, but this is something that will definitely come up, as we plan to integrate the failure store in various places to make it easy for users to mitigate ingestion issues.

elasticsearchmachine commented 6 months ago

Pinging @elastic/es-analytical-engine (Team:Analytics)

flash1293 commented 6 months ago

cc @jbaiera - there might have been discussions around this already

flash1293 commented 6 months ago

cc @yngrdyn @davismcphee - I think this will become relevant soon

nik9000 commented 6 months ago

Merging the failure store documents with the successful ones sounds like it'd change the shape of the output quite a bit and make ESQL tricky to use. Not impossible at all, but tricky.

flash1293 commented 6 months ago

FWIW, limiting the choice to only and exclude would make sense to me as well