forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add date_nanos support to Time field (elastic#151374)
Fixes: elastic#145855 `Time field` in rule update/create forms shows only the fields with `date` data type. This PR adds `date_nanos` type as well. ## To verify: - Create an index that has fields with `date` and `date_nanos` types. ``` PUT test-index-date { "mappings": { "properties": { "date": { "type": "date" }, "timestamp": { "type": "date_nanos" } } } } ``` - Add data with `date` and `date_nanos` data types Note: You can use https://www.site24x7.com/tools/time-stamp-converter.html address to generate date_nanos timestamps with a date you desired. ``` PUT test-index-date/_bulk?refresh { "index" : { "_id" : "1" } } { "date": "2023-02-15T18:00:00.000Z", "timestamp": 1676480400000} { "index" : { "_id" : "2" } } { "date": "2023-02-15T18:00:00.000Z", "timestamp": 1676480400000 } ``` - Open a Rule create form and select `Elasticsearch query` - Select `Query DSL` - Click on `select an index` - Type the above index name (test-index-date) in `Indices to query` input - Select `timestamp` from time field - Click on `Test Query` button and expect to see `Query matched 2 documents in the last 5m.` (cherry picked from commit 58204cf)
- Loading branch information
1 parent
272471d
commit dc16d40
Showing
6 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters