<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Date math support in index names(索引名稱對 Date 和 Math 的支持) 原文鏈接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/date-math-index-names.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/date-math-index-names.html) 譯文鏈接 : [http://www.apache.wiki/pages/viewpage.action?pageId=4882849](http://www.apache.wiki/pages/viewpage.action?pageId=4882849) 貢獻者 : [小瑤](/display/~chenyao),[ApacheCN](/display/~apachecn),[Apache中文網](/display/~apachechina) **Date math** 索引名稱解析可以讓您搜索一系列 **time-series indices**(時間序列索引),而不是搜索所有時間序列索引并過濾結果或維護 **aliases**(別名)。限制搜索的索引數量減少了集群上的集群上的負載,并提高了執行性能。例如,如果您在日常日志中 **searching for errors**(搜索錯誤?),則可以使用 **date math name** 模板將搜索限制為過去兩天。 幾乎所有的具有索引參數的 **API**?都支持在 **index parameter value**(索引參數值)中包含 **date math** 。 **date math** 索引名稱采用以下形式 :? ``` <static_name{date_math_expr{date_format|time_zone}}> ``` 上述的說明 :? | 位置 | 說明 | | --- | --- | | **static_name** | 是名稱的 **static text**( 靜態文本)部分 | | **date_math_expr** | 是動態計算日期的動態 **date math** 表達式 | | **date_format** | 是計算日期應呈現的可選格式。默認是 **YYYY.MM.dd** | | **time_zone** | 是可選的時區。默認為 **utc** 。 | 你必須將 **date math** 索引名稱表達式包含在尖括號中,并且所有的特殊字符都應進行 **URI** 編碼。例如 :? ``` # GET /<logstash-{now/d}>/_search curl -XGET 'localhost:9200/%3Clogstash-%7Bnow%2Fd%7D%3E/_search?pretty' -H 'Content-Type: application/json' -d' { "query" : { "match": { "test": "data" } } } ' ``` Note(注意): ## date math 字符的百分號編碼 用于?**date**?舍入的特殊字符必須按照如下**?URI**?編碼 : | 字符 | 編碼 | | --- | --- | | `&lt;` | `%3C` | | &gt; | %3E | | / | `%2F` | | { | %7B | | } | %7D | | &#124; | `%7C` | | + | %2B | | : | %3A | | `,` | `%2C` | 以下示例顯示了不同形式的 **date math index names**(日期數學索引名稱)和它們解析的 **final index names**(最終索引名稱),它們給定的當前時間是 **2024?**年 **3?**月 **22?**日中午 **utc**。 | 表達式 | 解析結果 | | --- | --- | | **&lt;logstash-{now/d}&gt;** | **logstash-2024.03.22** | | **&lt;logstash-{now/M}&gt;** | **logstash-2024.03.01** | | **&lt;logstash-{now/M{YYYY.MM}}&gt;** | **logstash-2024.03** | | **&lt;logstash-{now/M-1M{YYYY.MM}}&gt;** | **logstash-2024.02** | | **&lt;logstash-{now/d{YYYY.MM.dd&#124;+12:00}}&gt;** | **logstash-2024.03.23** | 為了在索引名稱模板的?**static part**(靜態部分)中使用字符**?{**?和**?}**?,使用**?\**?對其進行轉義,例如 :? ``` <elastic\\{ON\\}-{now/M}> resolves to elastic{ON}-2024.03.01 ``` 下面的示例顯示了一個搜索請求,搜索**?LogStash**?索引在過去的三天里,假設索引使用默認的?**LogStash**?索引名稱格式,?**logstash-YYYY.MM.dd**?。 ``` # GET /<logstash-{now/d-2d}>,<logstash-{now/d-1d}>,<logstash-{now/d}>/_search GET /%3Clogstash-%7Bnow%2Fd-2d%7D%3E%2C%3Clogstash-%7Bnow%2Fd-1d%7D%3E%2C%3Clogstash-%7Bnow%2Fd%7D%3E/_search { "query" : { "match": { "test": "data" } } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看