Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Backport This will backport the following commits from `main` to `8.7`: - [Add date_nanos support to Time field (#151374)](#151374) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ersin Erdal","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-02-21T15:25:09Z","message":"Add date_nanos support to Time field (#151374)\n\nFixes: #145855 \r\n\r\n`Time field` in rule update/create forms shows only the fields with\r\n`date` data type. This PR adds `date_nanos` type as well.\r\n\r\n## To verify:\r\n\r\n- Create an index that has fields with `date` and `date_nanos` types.\r\n```\r\nPUT test-index-date\r\n{\r\n \"mappings\": {\r\n \"properties\": {\r\n \"date\": {\r\n \"type\": \"date\"\r\n },\r\n \"timestamp\": {\r\n \"type\": \"date_nanos\"\r\n }\r\n }\r\n }\r\n}\r\n```\r\n- Add data with `date` and `date_nanos` data types\r\nNote: You can use\r\nhttps://www.site24x7.com/tools/time-stamp-converter.html address to\r\ngenerate date_nanos timestamps with a date you desired.\r\n```\r\nPUT test-index-date/_bulk?refresh\r\n{ \"index\" : { \"_id\" : \"1\" } }\r\n{ \"date\": \"2023-02-15T18:00:00.000Z\", \"timestamp\": 1676480400000} \r\n{ \"index\" : { \"_id\" : \"2\" } }\r\n{ \"date\": \"2023-02-15T18:00:00.000Z\", \"timestamp\": 1676480400000 } \r\n```\r\n- Open a Rule create form and select `Elasticsearch query`\r\n- Select `Query DSL`\r\n- Click on `select an index`\r\n- Type the above index name (test-index-date) in `Indices to query`\r\ninput\r\n- Select `timestamp` from time field\r\n- Click on `Test Query` button and expect to see `Query matched 2\r\ndocuments in the last 5m.`","sha":"58204cf2a0fd2b921d5f5c3e138b725bce1c5229","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v8.7.0","v8.8.0"],"number":151374,"url":"https://github.com/elastic/kibana/pull/151374","mergeCommit":{"message":"Add date_nanos support to Time field (#151374)\n\nFixes: #145855 \r\n\r\n`Time field` in rule update/create forms shows only the fields with\r\n`date` data type. This PR adds `date_nanos` type as well.\r\n\r\n## To verify:\r\n\r\n- Create an index that has fields with `date` and `date_nanos` types.\r\n```\r\nPUT test-index-date\r\n{\r\n \"mappings\": {\r\n \"properties\": {\r\n \"date\": {\r\n \"type\": \"date\"\r\n },\r\n \"timestamp\": {\r\n \"type\": \"date_nanos\"\r\n }\r\n }\r\n }\r\n}\r\n```\r\n- Add data with `date` and `date_nanos` data types\r\nNote: You can use\r\nhttps://www.site24x7.com/tools/time-stamp-converter.html address to\r\ngenerate date_nanos timestamps with a date you desired.\r\n```\r\nPUT test-index-date/_bulk?refresh\r\n{ \"index\" : { \"_id\" : \"1\" } }\r\n{ \"date\": \"2023-02-15T18:00:00.000Z\", \"timestamp\": 1676480400000} \r\n{ \"index\" : { \"_id\" : \"2\" } }\r\n{ \"date\": \"2023-02-15T18:00:00.000Z\", \"timestamp\": 1676480400000 } \r\n```\r\n- Open a Rule create form and select `Elasticsearch query`\r\n- Select `Query DSL`\r\n- Click on `select an index`\r\n- Type the above index name (test-index-date) in `Indices to query`\r\ninput\r\n- Select `timestamp` from time field\r\n- Click on `Test Query` button and expect to see `Query matched 2\r\ndocuments in the last 5m.`","sha":"58204cf2a0fd2b921d5f5c3e138b725bce1c5229"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151374","number":151374,"mergeCommit":{"message":"Add date_nanos support to Time field (#151374)\n\nFixes: #145855 \r\n\r\n`Time field` in rule update/create forms shows only the fields with\r\n`date` data type. This PR adds `date_nanos` type as well.\r\n\r\n## To verify:\r\n\r\n- Create an index that has fields with `date` and `date_nanos` types.\r\n```\r\nPUT test-index-date\r\n{\r\n \"mappings\": {\r\n \"properties\": {\r\n \"date\": {\r\n \"type\": \"date\"\r\n },\r\n \"timestamp\": {\r\n \"type\": \"date_nanos\"\r\n }\r\n }\r\n }\r\n}\r\n```\r\n- Add data with `date` and `date_nanos` data types\r\nNote: You can use\r\nhttps://www.site24x7.com/tools/time-stamp-converter.html address to\r\ngenerate date_nanos timestamps with a date you desired.\r\n```\r\nPUT test-index-date/_bulk?refresh\r\n{ \"index\" : { \"_id\" : \"1\" } }\r\n{ \"date\": \"2023-02-15T18:00:00.000Z\", \"timestamp\": 1676480400000} \r\n{ \"index\" : { \"_id\" : \"2\" } }\r\n{ \"date\": \"2023-02-15T18:00:00.000Z\", \"timestamp\": 1676480400000 } \r\n```\r\n- Open a Rule create form and select `Elasticsearch query`\r\n- Select `Query DSL`\r\n- Click on `select an index`\r\n- Type the above index name (test-index-date) in `Indices to query`\r\ninput\r\n- Select `timestamp` from time field\r\n- Click on `Test Query` button and expect to see `Query matched 2\r\ndocuments in the last 5m.`","sha":"58204cf2a0fd2b921d5f5c3e138b725bce1c5229"}}]}] BACKPORT--> Co-authored-by: Ersin Erdal <[email protected]>
- Loading branch information