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
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.
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
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?
User | Count |
---|---|
2534 | |
1351 | |
795 | |
641 | |
455 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.