{"id":11085,"date":"2024-07-09T21:34:00","date_gmt":"2024-07-10T02:34:00","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=11085"},"modified":"2024-07-26T11:36:05","modified_gmt":"2024-07-26T16:36:05","slug":"opensearch-elasticsearch-query-finding-the-date-range-of-an-index","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=11085","title":{"rendered":"OpenSearch\/ElasticSearch Query: Finding the date range of an index"},"content":{"rendered":"\n<p>A quick query to get the max and min timestamp values of an index:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#Find the date range of records within an index\ncurl -X GET &quot;https:\/\/opensearch.example.com:9200\/INDEX_NAME\/_search&quot; -H &#039;Content-Type: application\/json&#039; -d&#039;\n{\n  &quot;size&quot;: 0,\n  &quot;aggs&quot;: {\n    &quot;oldest_timestamp&quot;: {\n      &quot;min&quot;: {\n        &quot;field&quot;: &quot;@timestamp&quot;\n      }\n    },\n    &quot;newest_timestamp&quot;: {\n      &quot;max&quot;: {\n        &quot;field&quot;: &quot;@timestamp&quot;\n      }\n    }\n  }\n}&#039;\n\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>A quick query to get the max and min timestamp values of an index:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1588,1744],"tags":[1590,1589,1740],"class_list":["post-11085","post","type-post","status-publish","format-standard","hentry","category-elk","category-opensearch","tag-elasticsearch","tag-elk","tag-opensearch"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11085"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11085\/revisions"}],"predecessor-version":[{"id":11086,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11085\/revisions\/11086"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}