Skip to content

Commit 4754c30

Browse files
stefnestorkilfoyleabdonpijpelink
authored
Search-Troubleshoot | Most Recent Record (#94409) (#94678)
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 <[email protected]> Co-authored-by: Abdon Pijpelink <[email protected]>
1 parent b800ffd commit 4754c30

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/reference/troubleshooting/troubleshooting-searches.asciidoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ PUT my-index-000001
6565
{
6666
"mappings": {
6767
"properties": {
68+
"@timestamp": {
69+
"type": "date"
70+
},
6871
"my-field": {
6972
"type": "keyword"
7073
},
@@ -224,6 +227,21 @@ GET my-index-000001/_search?filter_path=aggregations
224227
If the field does not return any values, check the data ingestion process. The
225228
field may have a different name.
226229

230+
[discrete]
231+
[[troubleshooting-searches-latest-data]]
232+
=== Check the latest value
233+
234+
For time-series data, confirm there is non-filtered data within the attempted
235+
time range. For example, if you are trying to query the latest data for the
236+
`@timestamp` field, run the following to see if the max `@timestamp` falls
237+
within the attempted range:
238+
239+
[source,console]
240+
----
241+
GET my-index-000001/_search?sort=@timestamp:desc&size=1
242+
----
243+
//TEST[continued]
244+
227245
[discrete]
228246
[[troubleshooting-searches-validate-explain-profile]]
229247
=== Validate, explain, and profile queries

0 commit comments

Comments
 (0)