Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date range filter not working #2793

Closed
LuisCordobaDataSite opened this issue Mar 21, 2024 · 2 comments · Fixed by #2794
Closed

Date range filter not working #2793

LuisCordobaDataSite opened this issue Mar 21, 2024 · 2 comments · Fixed by #2794
Assignees
Labels
bug Something isn't working

Comments

@LuisCordobaDataSite
Copy link

Describe the bug
Using the command atlas events projects list, the maxDate and minDate filters are not being applied.
The exact command is:
atlas events projects list --output json --projectId 5ef516da5cc30930bcd83889 --maxDate 2024-03-18T15:00:03+00:00Z --minDate 2024-03-18T14:40:03+00:00Z --limit 500 --page 1
I try to get event logs of the last 20 mins, but the result is approximately 11 million records.
I changed the minDate to 24 hours ago, and the totalCount is the same.
Also in the response href:

"links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas/v2/groups/5ef516da5cc30930bcd83889/events?includeCount=true\u0026includeRaw=false\u0026pageNum=1\u0026itemsPerPage=500",
      "rel": "self"
    },
    {
      "href": "https://cloud.mongodb.com/api/atlas/v2/groups/5ef516da5cc30930bcd83889/events?includeCount=true\u0026includeRaw=false\u0026itemsPerPage=500\u0026pageNum=2",
      "rel": "next"
    }
  ]

You can't see the dates in the href, so my best guess is that the CLI is not implementing the filter in the request to the server.

To Reproduce
Steps to reproduce the behavior:

  1. Run atlas events projects list with the min-max date filter
  2. In the response, verify if the totalCount varies and if the href has the dates in the URL

Expected behavior
I need the filters to be implemented so I can get only the logs from a certain period of time.

Desktop (please complete the following information):
OS:
3.19.1
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.19.1
PRETTY_NAME="Alpine Linux v3.19"

MongoCLI version [e.g. 1.2]
atlascli version: 1.14.2
git version: 47dc06c
Go version: go1.21.6
os: linux
arch: amd64
compiler: gc

Additional context
Pretty sure we don't produce 11 million logs in 20 minutes, I've been trying to retrieve 11 million logs from your system, and after page 1000, I start getting 500 error timeout, just an FYI

Copy link
Contributor

Thanks for opening this issue. The ticket CLOUDP-238932 was created for internal tracking.

@blva blva self-assigned this Mar 21, 2024
@blva
Copy link
Contributor

blva commented Mar 21, 2024

Hi @LuisCordobaDataSite, thank you for reporting this issue.

We have identified and reproduced your reported error. The root cause is that the timestamp parsing in the command is silently failing, hence the command executes but minDate and maxDate are not actually being set. To fix this, we will open a PR to validate those flags and properly report the issue to users. Furthermore, I'll also add extra docs in the help of the flags, so that we share the expected time format.

Meanwhile, to unblock you, I can suggest that you convert the dates you provided into one of these formats: RFC3339 or "2006-01-02T15:04:05-0700", that should make your command run successfully.

E.g.

atlas events projects list --output json --projectId 5ef516da5cc30930bcd83889  --maxDate 2024-03-18T15:00:03-0000 --minDate 2024-03-18T14:40:03-0000 --limit 500 --page 1

Again, thanks for reporting and apologies for the inconvenience.

Update: the issue has been fixed and will be released on March 27th.

@blva blva added the bug Something isn't working label Mar 21, 2024
@blva blva linked a pull request Mar 21, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants