Opensearch-reporting-cli download custom time interval

Hello Everyone i just have a small question in regards to the reporting cli so i use this command to send the report to an email address

opensearch-reporting-cli --url https://some_server_address:443/app/dashboards?security_tenant=global#/view/ce76b220-6803-11ee-8d25-7b18287bc2bf --format pdf --auth basic --credentials admin:some_password --transport smtp --from some_email@domain.com --to some_email@domain.com --smtphost smtp.gmail.com --smtpport 587 --smtpusername some_username --smtppassword "some_password" --subject weekly wazuh vulnerability report test

and this works perfectly fine the report gets generated and emailed but i see that by default it downloads last 24 hours while i need at least last 7 days i tried changing the filter but the url i get and subsequent command i try to run looks like this:

opensearch-reporting-cli --url "https://some_server_address:443/app/dashboards?security_tenant=global#/view/ce76b220-6803-11ee-8d25-7b18287bc2bf?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-7d,to:now))&_a=(description:'',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),timeRestore:!f,title:'Vulnerabilities%20Summary',viewMode:view)" --format pdf --auth basic --credentials admin:some_password --transport smtp --from some_email@domain.com --to some_email@domain.com --smtphost smtp.gmail.com --smtpport 587 --smtpusername some_username --smtppassword ""some_password"" --subject weekly wazuh vulnerability report test

and as a result i get this as:
bash: !: event not found

Which i am assuming is because the cli is unable to read the url that gets generated when you edit the time frame on the dashboard, if anyone would know of where Iā€™m supposed to edit the format i would be very grateful

Hi @JumpyWizard
Have you generated the link as a Shapshot in your second command?
Please try to do the following steps in order to get the URL and run the second command again:

Share > Permalinks > Generate link as Shapshot > Short URL > Copy link

1 Like

Hi @Eugene7 this has in fact worked and i can download the report with last 7 days of information thank you!

2 Likes