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.
[ResponseOps] Pass in the timefield for ES|QL test query (elastic#176111
) Resolves elastic#174697 ## Summary This PR updates the ESQL `onTestQuery` function to pass in the time field to the query. The query function `fetchFieldsFromESQL` gets the time field from a data view, so I made a data view with just the time field to pass in. ### To verify - Go to Dev Tools and add a few documents to a test index ``` POST test/_doc { "@timestamp": "2024-02-02T16:30:00.000Z", "host": { "id": "1", "name": "host-1", "hostname": "host-1" } } ``` Add a few documents with timestamps in last 5 minutes (or whatever timerange you want to use for the rule) and some with older timestamps - Create an ESQL rule with query that projects the timestamp and test the query. Verify that the documents found in the test are within the time range you set for the rule and the count of the documents matches the test data you added in the index. <img width="574" alt="Screen Shot 2024-02-02 at 8 49 00 AM" src="https://github.com/elastic/kibana/assets/109488926/bc3bce8e-544a-4e99-984c-4cc6eb0e8746"> --------- Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
- Loading branch information
Showing
2 changed files
with
28 additions
and
8 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