Skip to content

Commit

Permalink
Search-Troubleshoot | Most Recent Record (#94409) (#94678)
Browse files Browse the repository at this point in the history
May we add a section to [this page](https://www.elastic.co/guide/en/elasticsearch/reference/master/troubleshooting-searches.html#troubleshooting-check-field-values) to query for the latest record on an index (pattern)? This will be helpful to decide between Kibana Discover filter and Elasticsearch ingest lag problems.

---------

Co-authored-by: David Kilfoyle <41695641+kilfoyle@users.noreply.github.com>
Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
  • Loading branch information
3 people authored Mar 23, 2023
1 parent b800ffd commit 4754c30
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/reference/troubleshooting/troubleshooting-searches.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ PUT my-index-000001
{
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"my-field": {
"type": "keyword"
},
Expand Down Expand Up @@ -224,6 +227,21 @@ GET my-index-000001/_search?filter_path=aggregations
If the field does not return any values, check the data ingestion process. The
field may have a different name.

[discrete]
[[troubleshooting-searches-latest-data]]
=== Check the latest value

For time-series data, confirm there is non-filtered data within the attempted
time range. For example, if you are trying to query the latest data for the
`@timestamp` field, run the following to see if the max `@timestamp` falls
within the attempted range:

[source,console]
----
GET my-index-000001/_search?sort=@timestamp:desc&size=1
----
//TEST[continued]

[discrete]
[[troubleshooting-searches-validate-explain-profile]]
=== Validate, explain, and profile queries
Expand Down

0 comments on commit 4754c30

Please sign in to comment.