- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how can show logs in blocks with filter by api
hello guys
i have problem with this api request
start = 0
limit=1
all_policies=[]
while true:
url = f"{base_url}/api/v2/cmdb/firewall/policy?vdom={vdom}&start={start}&rows={limit}"
response = requests.get(url, headers=headers, verify=False)
if response.status_code == 200:
policies = response.json().get("results", [])
all_policies.append(policies)
if not policies:
break # No more policies to fetch
start+=limit
​
when i print all_policies in every loop, the first log show every request, that means the start in the URL does not work correctly
how can i take logs block by block?
the first request get log number 1 to 1000
the second request get log number 1001 to 2000
and so on
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
i dont think this would be possible.
first of all, the filters start= and rows= dont exist in the API for firewall policy.
you could fetch all the policyid's with the one that you already are calling, put them in a list and then make blocks of X and fetch them using the /firewall/policy/{policyid} URI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if i send one request to get logs the device maybe crashed beacuse the logs = 10G for one month
and i dont know how to filter time for request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Mohammed_Waked ,
I am not familiar with API requests.
However, if you have an FAZ, why not use FAZ? Or a third-party log server (i.e. a Syslog server) for log filtering?
Jerry
