- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
12-12-2023 06:19 PM
Anyone have any examples of adding log forwarding profiles with match lists and actions using the pan-os-python API?
Here's a sample that has me stuck:
from panos.panorama import Panorama, DeviceGroup
from panos.objects import LogForwardingProfile,LogForwardingProfileMatchList,LogForwardingProfileMatchListAction
pano = Panorama(hostname='xxx', api_key='api_key-here')
dg = DeviceGroup("Test1")
pano.add(dg)
obj=LogForwardingProfile("LFP1")
dg.add(obj)
obj.create()
That creates the new log forwarding profile, but then how do I attach the match lists and match list actions to the new profile?
12-13-2023 05:34 AM
I figured it out, just took a while for the object hierarchy to sink in:
obj=LogForwardingProfile("LFP1")
obj.add(LogForwardingProfileMatchList(name="Rule1",filter="All Logs",log_type="traffic",send_to_panorama="True"))
dg.add(obj)
obj.create()
12-13-2023 05:34 AM
I figured it out, just took a while for the object hierarchy to sink in:
obj=LogForwardingProfile("LFP1")
obj.add(LogForwardingProfileMatchList(name="Rule1",filter="All Logs",log_type="traffic",send_to_panorama="True"))
dg.add(obj)
obj.create()
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!