Forum Discussion
REST - Retrieve ASM Log by support id
Hi, I was wondering if there is a way to retrieve a specific log by support_id from ASM using the iControl REST API?
- asmapiquestionsNimbostratus
This doesn't seem to work.
I generated a support ID and used the ASM GUI to search for it while capturing network traffic in Chrome developer tools. The GUI returns results correctly and from the dev tools I can see the GET request looks like this: https://<url>/mgmt/tm/asm/events/requests?$filter=id+eq+8704491664851628377&top=10&servertime=true.
When I try to recreate this request with the REST API, I have tried the following (where support_id=8704491664851628377):
url_suffix = f'asm/events/requests/{support_id}' return self._http_request(method='GET', headers=self.headers, url_suffix=url_suffix, json_data={})
Which results in a 404 error: "Could not get the Request Log, No matching record was found." However I know there is a matching record because of the dev tools request/response.
I also tried:
url_suffix = f'asm/events/requests?$filter=id eq {support_id}' return self._http_request(method='GET', headers=self.headers, url_suffix=url_suffix, json_data={})
Which returns some json but no results:
items:[]itemsPerPage:500kind:tm:asm:events:requests:requestcollectionstatepageIndex:1selfLink:https://localhost/mgmt/tm/asm/events/requests?$top=500&ver=14.1.5&$filter=id%20eq%208704491664851628377startIndex:1totalItems:0totalPages:0How can we get this to work correctly?
- KarimCirrostratus
Hi,
do you guys have a suggestion on how we can, via API, get all the logged requests for a specific violation ?
To to get a specific request (with support id) you can use :
https://<mgmt_IP>/mgmt/tm/asm/events/requests/<support_id>?ver=14.0.0
Many thanks,
Hi,
You can do it like this:
mgmt/tm/asm/events/requests?$id=5027561620025376914
Where id is support_id
Hope this helps.
- SvenF_288567Nimbostratus
Hi, I tried this on 12.1.1 (Icontrol Rest) but then I get the top 500 results. So it's doesn't take the filter based on the supportID
The only thing that works is
/mgmt/tm/asm/events/requests/
Does someone knows how to use the the filter with the rest api, for example all blocked requests for policy X. Do you need to post a json that contains specific filter info, or just a GET with parameters?
Regards
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com