Skip to main content
Mohammed_Waked
New Member
February 23, 2025
Question

how can show logs in blocks with filter by api

  • February 23, 2025
  • 3 replies
  • 1072 views

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

 

3 replies

funkylicious
SuperUser
SuperUser
February 23, 2025

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.

"jack of all trades, master of none"
Mohammed_Waked
New Member
February 23, 2025

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

dingjerry_FTNT
Staff
Staff
February 24, 2025

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?

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!